From: Raymond Hettinger Date: Tue, 19 May 2009 17:43:59 +0000 (+0000) Subject: Note that ordered dictionaries work with reversed(). X-Git-Tag: v2.7a1~1149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50f362fffa768e17544f29eb6001fbb3d86c02aa;p=thirdparty%2FPython%2Fcpython.git Note that ordered dictionaries work with reversed(). --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index eaab33e105f5..5475776c5086 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -868,6 +868,9 @@ the items are returned in the order their keys were first added. a (key, value) pair. The pairs are returned in LIFO order if *last* is true or FIFO order if false. +In addition to the usual mapping methods, ordered dictionaries also support +reverse iteration using :func:`reversed`. + Equality tests between :class:`OrderedDict` objects are order-sensitive and are implemented as ``list(od1.items())==list(od2.items())``. Equality tests between :class:`OrderedDict` objects and other