Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e909150

Browse files
committed
Note that ordered dictionaries work with reversed().
1 parent 822eb84 commit e909150

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Doc/library/collections.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -844,6 +844,9 @@ the items are returned in the order their keys were first added.
844844
a (key, value) pair. The pairs are returned in LIFO order if *last* is
845845
true or FIFO order if false.
846846

847+
In addition to the usual mapping methods, ordered dictionaries also support
848+
reverse iteration using :func:`reversed`.
849+
847850
Equality tests between :class:`OrderedDict` objects are order-sensitive
848851
and are implemented as ``list(od1.items())==list(od2.items())``.
849852
Equality tests between :class:`OrderedDict` objects and other

0 commit comments

Comments
 (0)