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

Class Missing

Lib/test/test_ordered_dict.py:270–272  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269 # make sure pop still works when __missing__ is defined
270 class Missing(OrderedDict):
271 def __missing__(self, key):
272 return 0
273 m = Missing(a=1)
274 self.assertEqual(m.pop('b', 5), 5)
275 self.assertEqual(m.pop('a', 6), 1)

Callers 2

test_popMethod · 0.70
test_setdefaultMethod · 0.70

Calls

no outgoing calls

Tested by 2

test_popMethod · 0.56
test_setdefaultMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…