MCPcopy Create free account
hub / github.com/ActiveState/code / get

Method get

recipes/Python/577580_weak_reference_map/recipe-577580.py:43–49  ·  view source on GitHub ↗
(self, key, **kwargs)

Source from the content-addressed store, hash-verified

41 self.__backref.setdefault(ival, set()).add(ikey)
42
43 def get(self, key, **kwargs):
44 ikey = id(key)
45 if ikey in self.__map:
46 return self.__valmemo[self.__map[ikey][0]]()
47 if 'default' in kwargs:
48 return kwargs['default']
49 raise KeyError(str(key))
50
51 def pop(self, key):
52 ikey = id(key)

Callers 9

recipe-577570.pyFile · 0.45
updateMethod · 0.45
_read_Method · 0.45
switchMethod · 0.45
forget_valueMethod · 0.45
_read_Method · 0.45
searchMethod · 0.45
closeMethod · 0.45
startMethod · 0.45

Calls 1

strFunction · 0.85

Tested by

no test coverage detected