diff options
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/collections.rst | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 1a23fca..b136cf1 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -836,8 +836,11 @@ the items are returned in the order their keys were first added. .. versionadded:: 3.1 -The :meth:`popitem` method for ordered dictionaries returns and removes the -last added entry. The key/value pairs are returned in LIFO order. +.. method:: OrderedDict.popitem(last=True) + + The :meth:`popitem` method for ordered dictionaries returns and removes + a (key, value) pair. The pairs are returned in LIFO order if *last* is + true or FIFO order if false. Equality tests between :class:`OrderedDict` objects are order-sensitive and are implemented as ``list(od1.items())==list(od2.items())``. @@ -846,6 +849,11 @@ Equality tests between :class:`OrderedDict` objects and other This allows :class:`OrderedDict` objects to be substituted anywhere a regular dictionary is used. +.. seealso:: + + `Equivalent OrderedDict recipe <http://code.activestate.com/recipes/576693/>`_ + that runs on Python 2.4 or later. + :class:`UserDict` objects ------------------------- |