MCPcopy Create free account
hub / github.com/RustPython/RustPython / DefaultChainMap

Class DefaultChainMap

Lib/test/test_collections.py:175–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173
174 def test_missing(self):
175 class DefaultChainMap(ChainMap):
176 def __missing__(self, key):
177 return 999
178 d = DefaultChainMap(dict(a=1, b=2), dict(b=20, c=30))
179 for k, v in dict(a=1, b=2, c=30, d=999).items():
180 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