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

Class BadHash

Lib/test/mapping_tests.py:559–565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557 self.assertRaises(KeyError, d.__getitem__, 23)
558
559 class BadHash(object):
560 fail = False
561 def __hash__(self):
562 if self.fail:
563 raise Exc()
564 else:
565 return 42
566
567 d = self._empty_mapping()
568 x = BadHash()

Callers 3

test_getitemMethod · 0.70
test_popMethod · 0.70
test_setdefaultMethod · 0.70

Calls

no outgoing calls

Tested by 3

test_getitemMethod · 0.56
test_popMethod · 0.56
test_setdefaultMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…