def _get_history_max_index(self):
        return len(self._IP.input_hist_raw)-1
returns the max length of the history buffer
dataset/ETHPy150Open ipython/ipython-py3k/IPython/deathrow/gui/wx/ipshell_nonblocking.py/NonBlockingIPShell._get_history_max_index