diff options
author | Raymond Hettinger <python@rcn.com> | 2004-02-07 02:45:22 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-02-07 02:45:22 (GMT) |
commit | c058fd14a9abdffff4f65ebd87a042fad6e68a2e (patch) | |
tree | 41f0a0e596a48de87bd46fab96b07de585a45380 /Doc/lib | |
parent | b5ba8d749d66403edab1eaf9f3f83006134c0a67 (diff) | |
download | cpython-c058fd14a9abdffff4f65ebd87a042fad6e68a2e.zip cpython-c058fd14a9abdffff4f65ebd87a042fad6e68a2e.tar.gz cpython-c058fd14a9abdffff4f65ebd87a042fad6e68a2e.tar.bz2 |
* Fix ref counting in extend() and extendleft().
* Let deques support reversed().
Diffstat (limited to 'Doc/lib')
-rw-r--r-- | Doc/lib/libcollections.tex | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/lib/libcollections.tex b/Doc/lib/libcollections.tex index ebb2079..55ab431 100644 --- a/Doc/lib/libcollections.tex +++ b/Doc/lib/libcollections.tex @@ -60,7 +60,7 @@ Deque objects support the following methods: In addition to the above, deques support iteration, membership testing using the \keyword{in} operator, \samp{len(d)}, \samp{copy.copy(d)}, -\samp{copy.deepcopy(d)}, and pickling. +\samp{copy.deepcopy(d)}, \samp{reversed(d)} and pickling. Example: @@ -84,6 +84,8 @@ deque(['f', 'g', 'h', 'i', 'j']) 'f' >>> list(d) # list the contents of the deque ['g', 'h', 'i'] +>>> list(reversed(d)) # list the contents of a deque in reverse +['i', 'h', 'g'] >>> 'h' in d # search the deque True >>> d.extend('jkl') # extend() will append many elements at once |