MCPcopy Index your code
hub / github.com/python/cpython / CustomReversedDict

Class CustomReversedDict

Lib/test/test_dict.py:1423–1430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1421 self.assertEqual(pairs, list(dict(d).items()))
1422
1423 class CustomReversedDict(dict):
1424 def keys(self):
1425 return reversed(list(dict.keys(self)))
1426
1427 __iter__ = keys
1428
1429 def items(self):
1430 return reversed(dict.items(self))
1431
1432 d = CustomReversedDict(pairs)
1433 self.assertEqual(pairs[::-1], list(dict(d).items()))

Callers 1

test_dict_copy_orderMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_dict_copy_orderMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…