MCPcopy Index your code
hub / github.com/RustPython/RustPython / CustomReversedDict

Class CustomReversedDict

Lib/test/test_dict.py:1428–1435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1426 self.assertEqual(pairs, list(dict(d).items()))
1427
1428 class CustomReversedDict(dict):
1429 def keys(self):
1430 return reversed(list(dict.keys(self)))
1431
1432 __iter__ = keys
1433
1434 def items(self):
1435 return reversed(dict.items(self))
1436
1437 d = CustomReversedDict(pairs)
1438 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