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

Method __init__

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

Source from the content-addressed store, hash-verified

26 __slots__ = 'key', 'dicts', 'localargs', 'locallock', '__weakref__'
27
28 def __init__(self):
29 # The key used in the Thread objects' attribute dicts.
30 # We keep it a string for speed but make it unlikely to clash with
31 # a "real" attribute.
32 self.key = '_threading_local._localimpl.' + str(id(self))
33 # { id(Thread) -> (ref(Thread), thread-local dict) }
34 self.dicts = {}
35
36 def get_dict(self):
37 """Return the dict for the current thread. Raises KeyError if none

Callers 1

_patchFunction · 0.45

Calls 2

strFunction · 0.85
idFunction · 0.85

Tested by

no test coverage detected