diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-02-07 23:10:33 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-02-07 23:10:33 (GMT) |
commit | 631507d1c6789df339b7e1115d992a9b60611121 (patch) | |
tree | f18a9bc9dfef8f29a5a41747d15167c7c2a943e8 /Doc/library/shelve.rst | |
parent | da397903c9f1fd80403322003b17727c52faf877 (diff) | |
download | cpython-631507d1c6789df339b7e1115d992a9b60611121.zip cpython-631507d1c6789df339b7e1115d992a9b60611121.tar.gz cpython-631507d1c6789df339b7e1115d992a9b60611121.tar.bz2 |
Issue #11141: Fix the shelve documentation to use a list, not a range object.
Patch by SilentGhost.
Diffstat (limited to 'Doc/library/shelve.rst')
-rw-r--r-- | Doc/library/shelve.rst | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst index 4b49a2f..9d7d504 100644 --- a/Doc/library/shelve.rst +++ b/Doc/library/shelve.rst @@ -169,8 +169,8 @@ object):: klist = list(d.keys()) # a list of all existing keys (slow!) # as d was opened WITHOUT writeback=True, beware: - d['xx'] = range(4) # this works as expected, but... - d['xx'].append(5) # *this doesn't!* -- d['xx'] is STILL range(4)! + d['xx'] = [0, 1, 2] # this works as expected, but... + d['xx'].append(3) # *this doesn't!* -- d['xx'] is STILL [0, 1, 2]! # having opened d without writeback=True, you need to code carefully: temp = d['xx'] # extracts the copy |