[Python-checkins] python/dist/src/Doc/lib libcollections.tex, 1.1,
1.2
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Fri Feb 6 14:04:59 EST 2004
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15523/Doc/lib
Modified Files:
libcollections.tex
Log Message:
Have deques support high volume loads.
Index: libcollections.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcollections.tex,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** libcollections.tex 29 Jan 2004 07:27:45 -0000 1.1
--- libcollections.tex 6 Feb 2004 19:04:56 -0000 1.2
***************
*** 38,41 ****
--- 38,52 ----
\end{methoddesc}
+ \begin{methoddesc}{extend}{iterable}
+ Extend the right side of the deque by appending elements from
+ the iterable argument.
+ \end{methoddesc}
+
+ \begin{methoddesc}{extendleft}{iterable}
+ Extend the left side of the deque by appending elements from
+ \var{iterable}. Note, the series of left appends results in
+ reversing the order of elements in the iterable argument.
+ \end{methoddesc}
+
\begin{methoddesc}{pop}{}
Remove and return an element from the right side of the deque.
***************
*** 76,84 ****
>>> 'h' in d # search the deque
True
! >>> d.__init__('jkl') # use __init__ to append many elements at once
>>> d
deque(['g', 'h', 'i', 'j', 'k', 'l'])
>>> d.clear() # empty the deque
! >>> d.pop() # try to pop from an empty deque
Traceback (most recent call last):
--- 87,95 ----
>>> 'h' in d # search the deque
True
! >>> d.extend('jkl') # extend() will append many elements at once
>>> d
deque(['g', 'h', 'i', 'j', 'k', 'l'])
>>> d.clear() # empty the deque
! >>> d.pop() # cannot pop from an empty deque
Traceback (most recent call last):
***************
*** 86,88 ****
--- 97,104 ----
d.pop()
LookupError: pop from an empty deque
+
+ >>> d.extendleft('abc') # extendleft() reverses the element order
+ >>> d
+ deque(['c', 'b', 'a'])
+
\end{verbatim}
More information about the Python-checkins
mailing list