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

Method __missing__

Lib/test/test_dict.py:839–840  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

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.45

Calls

no outgoing calls

Tested by

no test coverage detected