Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ddcacf3

Browse files
committed
Merged revisions 88377 via svnmerge from
svn+ssh://[email protected]/python/branches/py3k ........ r88377 | antoine.pitrou | 2011-02-08 00:10:33 +0100 (mar., 08 févr. 2011) | 4 lines Issue #11141: Fix the shelve documentation to use a list, not a range object. Patch by SilentGhost. ........
1 parent b248bdc commit ddcacf3

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/ACKS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ [email protected]), and we'll be glad to correct the problem.
179179
* Joakim Sernbrant
180180
* Justin Sheehy
181181
* Charlie Shepherd
182+
* SilentGhost
182183
* Michael Simcich
183184
* Ionel Simionescu
184185
* Michael Sloan

Doc/library/shelve.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ object)::
158158
klist = list(d.keys()) # a list of all existing keys (slow!)
159159

160160
# as d was opened WITHOUT writeback=True, beware:
161-
d['xx'] = range(4) # this works as expected, but...
162-
d['xx'].append(5) # *this doesn't!* -- d['xx'] is STILL range(4)!
161+
d['xx'] = [0, 1, 2] # this works as expected, but...
162+
d['xx'].append(3) # *this doesn't!* -- d['xx'] is STILL [0, 1, 2]!
163163

164164
# having opened d without writeback=True, you need to code carefully:
165165
temp = d['xx'] # extracts the copy

0 commit comments

Comments
 (0)