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

Class D

Lib/test/test_userdict.py:204–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202 # (F) subclass sets __missing__ instance variable (no effect)
203 # (G) subclass doesn't define __missing__ at all
204 class D(collections.UserDict):
205 def __missing__(self, key):
206 return 42
207 d = D({1: 2, 3: 4})
208 self.assertEqual(d[1], 2)
209 self.assertEqual(d[3], 4)

Callers 1

test_missingMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_missingMethod · 0.56