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

Class D

Lib/test/test_dict.py:838–840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

836 # (F) subclass sets __missing__ instance variable (no effect)
837 # (G) subclass doesn't define __missing__ at all
838 class D(dict):
839 def __missing__(self, key):
840 return 42
841 d = D({1: 2, 3: 4})
842 self.assertEqual(d[1], 2)
843 self.assertEqual(d[3], 4)

Callers 1

test_missingMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_missingMethod · 0.56