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

Function _patch

Lib/_threading_local.py:69–79  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

67
68@contextmanager
69def _patch(self):
70 impl = object.__getattribute__(self, '_local__impl')
71 try:
72 dct = impl.get_dict()
73 except KeyError:
74 dct = impl.create_dict()
75 args, kw = impl.localargs
76 self.__init__(*args, **kw)
77 with impl.locallock:
78 object.__setattr__(self, '__dict__', dct)
79 yield
80
81
82class local:

Callers 3

__getattribute__Method · 0.70
__setattr__Method · 0.70
__delattr__Method · 0.70

Calls 5

get_dictMethod · 0.80
create_dictMethod · 0.80
__getattribute__Method · 0.45
__init__Method · 0.45
__setattr__Method · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…