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

Method __missing__

Lib/test/test_dynamic.py:142–143  ·  view source on GitHub ↗
(self, key)

Source from the content-addressed store, hash-verified

140 # https://github.com/python/cpython/issues/91625
141 class MyGlobals(dict):
142 def __missing__(self, key):
143 return int(key.removeprefix("_number_"))
144
145 # Need more than 256 variables to use EXTENDED_ARGS
146 variables = 400

Callers

nothing calls this directly

Calls 1

removeprefixMethod · 0.45

Tested by

no test coverage detected