bpo-33418: Add tp_clear for function object by methane · Pull Request #8058 · python/cpython
Conversation
Without tp_clear, GC can't break cyclic reference. It will cause memory leak when cyclic reference is created intentionally.
I have doubts about backporting this change. This can expose bugs when a ref cycle be broken at unexpected place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters