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

Method get

Lib/importlib/_bootstrap.py:111–122  ·  view source on GitHub ↗
(self, key, default=None)

Source from the content-addressed store, hash-verified

109 _weakref._remove_dead_weakref(d, key)
110
111 def get(self, key, default=None):
112 if self._pending_removals:
113 self._commit_removals()
114 try:
115 wr = self.data[key]
116 except KeyError:
117 return default
118 else:
119 if (o := wr()) is None:
120 return default
121 else:
122 return o
123
124 def setdefault(self, key, default=None):
125 try:

Callers 7

_has_deadlockedFunction · 0.45
cbFunction · 0.45
_execFunction · 0.45
_find_and_load_unlockedFunction · 0.45
_find_and_loadFunction · 0.45
_handle_fromlistFunction · 0.45
_calc___package__Function · 0.45

Calls 1

_commit_removalsMethod · 0.95

Tested by

no test coverage detected