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

Class Key

Lib/test/test_ordered_dict.py:524–536  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

522 OrderedDict = self.OrderedDict
523
524 class Key:
525 def __init__(self, hash):
526 self._hash = hash
527 self.value = str(id(self))
528 def __hash__(self):
529 return self._hash
530 def __eq__(self, other):
531 try:
532 return self.value == other.value
533 except AttributeError:
534 return False
535 def __repr__(self):
536 return self.value
537
538 def blocking_hash(hash):
539 # See the collision-handling in lookdict (in Objects/dictobject.c).

Calls

no outgoing calls