cpython: cb08e5271cc0 (original) (raw)
Mercurial > cpython
changeset 99862:cb08e5271cc0
#25991: merge with 3.5. [#25991]
Ezio Melotti ezio.melotti@gmail.com | |
---|---|
date | Mon, 11 Jan 2016 23:31:38 +0200 |
parents | 6ab135134013(current diff)416db1a2fb81(diff) |
children | 48e2f5915d49 |
files | |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-)[+] [-] Doc/library/readline.rst 4 |
line wrap: on
line diff
--- a/Doc/library/readline.rst
+++ b/Doc/library/readline.rst
@@ -209,6 +209,8 @@ from the user's :envvar:PYTHONSTARTUP
histfile = os.path.join(os.path.expanduser("~"), ".python_history")
try:
readline.read_history_file(histfile)
# default history len is -1 (infinite), which may grow unruly[](#l1.7)
except FileNotFoundError: passreadline.set_history_length(1000)[](#l1.8)
@@ -234,6 +236,7 @@ sessions, by only appending the new hist def save(prev_h_len, histfile): new_h_len = readline.get_history_length()
atexit.register(save, h_len, histfile) @@ -261,4 +264,5 @@ support history save/restore. :: atexit.register(self.save_history, histfile)readline.set_history_length(1000)[](#l1.16) readline.append_history_file(new_h_len - prev_h_len, histfile)[](#l1.17)
def save_history(self, histfile):
readline.set_history_length(1000)[](#l1.24) readline.write_history_file(histfile)[](#l1.25)