Skip to content

Latest commit

 

History

History
9 lines (9 loc) · 647 Bytes

2024-04-24-12-20-48.gh-issue-118013.TKn_kZ.rst

File metadata and controls

9 lines (9 loc) · 647 Bytes

Fix regression introduced in gh-103193 that meant that calling :func:`inspect.getattr_static` on an instance would cause a strong reference to that instance's class to persist in an internal cache in the :mod:`inspect` module. This caused unexpected memory consumption if the class was dynamically created, the class held strong references to other objects which took up a significant amount of memory, and the cache contained the sole strong reference to the class. The fix for the regression leads to a slowdown in :func:`!getattr_static`, but the function should still be significantly faster than it was in Python 3.11. Patch by Alex Waygood.