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

Class DefaultChainMap

Lib/test/test_collections.py:176–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

174
175 def test_missing(self):
176 class DefaultChainMap(ChainMap):
177 def __missing__(self, key):
178 return 999
179 d = DefaultChainMap(dict(a=1, b=2), dict(b=20, c=30))
180 for k, v in dict(a=1, b=2, c=30, d=999).items():
181 self.assertEqual(d[k], v) # check __getitem__ w/missing

Callers 1

test_missingMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_missingMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…