From: Raymond Hettinger Date: Tue, 19 May 2009 17:40:07 +0000 (+0000) Subject: Note that ordered dictionaries work with reversed(). X-Git-Tag: v3.1rc1~101 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e90915011cd8a732de294d34a8d05fedfa15db1e;p=python Note that ordered dictionaries work with reversed(). --- diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst index 9dcf302810..3f5734884e 100644 --- a/Doc/library/collections.rst +++ b/Doc/library/collections.rst @@ -844,6 +844,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