Skip to content

Support for Python 3.14#10

Merged
liran-funaro merged 1 commit intoliran-funaro:masterfrom
natsukium:python314
Jan 18, 2026
Merged

Support for Python 3.14#10
liran-funaro merged 1 commit intoliran-funaro:masterfrom
natsukium:python314

Conversation

@natsukium
Copy link
Contributor

Python 3.14 added the f_generator attribute to frame objects, making the frame-to-generator reference explicit. This causes gc.get_referrers() to return the generator as a referrer, which breaks the exclusive object detection in traverse_exclusive_bfs().

This PR adds the generator's id to frame_set when 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

@liran-funaro liran-funaro force-pushed the python314 branch 3 times, most recently from fc5d7f3 to a39639c Compare January 18, 2026 12:33
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.
@liran-funaro liran-funaro merged commit 32eed1c into liran-funaro:master Jan 18, 2026
9 of 10 checks passed
@natsukium natsukium deleted the python314 branch January 19, 2026 00:44
@natsukium
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants