From 6952d6d03dc72f6246dcd4df7e0e759ff81367ce 2011-03-13 12:51:48 From: Thomas Kluyver Date: 2011-03-13 12:51:48 Subject: [PATCH] Small changes as suggested by Fernando. --- diff --git a/IPython/core/history.py b/IPython/core/history.py index af7c916..a5e8c59 100644 --- a/IPython/core/history.py +++ b/IPython/core/history.py @@ -55,6 +55,10 @@ class HistoryManager(object): # ShadowHist instance with the actual shadow history shadow_hist = None + # Offset so the first line of the current session is #1. Can be + # updated after loading history from file. + session_offset = -1 + # Private interface # Variables used to store the three last inputs from the user. On each new # history update, we populate the user's namespace with these, shifted as @@ -69,8 +73,12 @@ class HistoryManager(object): def __init__(self, shell, load_history=False): """Create a new history manager associated with a shell instance. - If load_history is true, it will load the history from file and set the - session offset so that the next line typed can be retrieved as #1. + Parameters + ---------- + load_history: bool, optional + If True, history will be loaded from file, and the session + offset set, so that the next line entered can be retrieved + as #1. """ # We need a pointer back to the shell for various tasks. self.shell = shell @@ -81,9 +89,6 @@ class HistoryManager(object): # pre-processing. This will allow users to retrieve the input just as # it was exactly typed in by the user, with %hist -r. self.input_hist_raw = [] - - # Offset so the first line of the current session is #1 - self.session_offset = -1 # list of visited directories try: