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

Function _shadowed_dict

Lib/inspect.py:1737–1747  ·  view source on GitHub ↗
(klass)

Source from the content-addressed store, hash-verified

1735
1736
1737def _shadowed_dict(klass):
1738 # gh-118013: the inner function here is decorated with lru_cache for
1739 # performance reasons, *but* make sure not to pass strong references
1740 # to the items in the mro. Doing so can lead to unexpected memory
1741 # consumption in cases where classes are dynamically created and
1742 # destroyed, and the dynamically created classes happen to be the only
1743 # objects that hold strong references to other objects that take up a
1744 # significant amount of memory.
1745 return _shadowed_dict_from_weakref_mro_tuple(
1746 *[make_weakref(entry) for entry in _static_getmro(klass)]
1747 )
1748
1749
1750def getattr_static(obj, attr, default=_sentinel):

Callers 2

_check_classFunction · 0.85
getattr_staticFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…