Support for Python 3.14#10
Merged
liran-funaro merged 1 commit intoliran-funaro:masterfrom Jan 18, 2026
Merged
Conversation
fc5d7f3 to
a39639c
Compare
In Python 3.14, inspect module added f_generator attribute to frame objects, making the frame-to-generator relationship explicit. This causes gc.get_referrers() to return the generator as a referrer for objects within the generator. Include the generator in frame_set using the new f_generator attribute.
a39639c to
8b454c8
Compare
Contributor
Author
|
Thank you! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python 3.14 added the
f_generatorattribute to frame objects, making the frame-to-generator reference explicit. This causesgc.get_referrers()to return the generator as a referrer, which breaks the exclusive object detection intraverse_exclusive_bfs().This PR adds the generator's id to
frame_setwhen the attribute exists, preventing objects from being incorrectly marked as non-exclusive.Tested with Python 3.10 - 3.14.
Reference: https://docs.python.org/3.14/library/inspect.html