summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d/next/Library/2024-04-24-12-20-48.gh-issue-118013.TKn_kZ.rst
blob: 8eb68ebe99ba155dde26afcf0f9af315b19dae96 (plain)
1
2
3
4
5
6
7
8
9
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 signficantly faster than it was in Python 3.11. Patch by Alex Waygood.