(klass)
| 1710 | |
| 1711 | |
| 1712 | def _shadowed_dict(klass): |
| 1713 | # gh-118013: the inner function here is decorated with lru_cache for |
| 1714 | # performance reasons, *but* make sure not to pass strong references |
| 1715 | # to the items in the mro. Doing so can lead to unexpected memory |
| 1716 | # consumption in cases where classes are dynamically created and |
| 1717 | # destroyed, and the dynamically created classes happen to be the only |
| 1718 | # objects that hold strong references to other objects that take up a |
| 1719 | # significant amount of memory. |
| 1720 | return _shadowed_dict_from_weakref_mro_tuple( |
| 1721 | *[make_weakref(entry) for entry in _static_getmro(klass)] |
| 1722 | ) |
| 1723 | |
| 1724 | |
| 1725 | def getattr_static(obj, attr, default=_sentinel): |
no test coverage detected