(klass)
| 1735 | |
| 1736 | |
| 1737 | def _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 | |
| 1750 | def getattr_static(obj, attr, default=_sentinel): |
no test coverage detected
searching dependent graphs…