diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-04-04 12:19:36 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-04-04 12:19:36 (GMT) |
commit | 578c9211d6b57bbb3cc00ba6dd55893814168695 (patch) | |
tree | 8bc9cf712977f0a6d3778d5c31b8dad4a4422a98 /Lib/test/test_collections.py | |
parent | 3d1e2e4cbb2033344128727bbbbe897bcf9fedfd (diff) | |
download | cpython-578c9211d6b57bbb3cc00ba6dd55893814168695.zip cpython-578c9211d6b57bbb3cc00ba6dd55893814168695.tar.gz cpython-578c9211d6b57bbb3cc00ba6dd55893814168695.tar.bz2 |
Issue #19505: The items, keys, and values views of OrderedDict now support
reverse iteration using reversed().
Diffstat (limited to 'Lib/test/test_collections.py')
-rw-r--r-- | Lib/test/test_collections.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py index ee28a6c..d352d2a 100644 --- a/Lib/test/test_collections.py +++ b/Lib/test/test_collections.py @@ -1187,6 +1187,11 @@ class TestOrderedDict(unittest.TestCase): self.assertEqual(list(od.items()), pairs) self.assertEqual(list(reversed(od)), [t[0] for t in reversed(pairs)]) + self.assertEqual(list(reversed(od.keys())), + [t[0] for t in reversed(pairs)]) + self.assertEqual(list(reversed(od.values())), + [t[1] for t in reversed(pairs)]) + self.assertEqual(list(reversed(od.items())), list(reversed(pairs))) def test_popitem(self): pairs = [('c', 1), ('b', 2), ('a', 3), ('d', 4), ('e', 5), ('f', 6)] |