Introduce support for Python 3.14 - #656
Conversation
achaikou
left a comment
There was a problem hiding this comment.
Happy to see this change wasn't anything bad! 👍
Now we just need to drop 3.9 and we are ready to go!
Regarding commit message:
I would have linked to
https://docs.python.org/3/whatsnew/3.14.html#optimizations
instead. I think it is more clear as the linked link leads to some internal C changes.
Also:
The difference comes from RefTrace's
fetchmethod:
in Python 3.14, its return value has a reference count of 0, while in
older versions it has reference count 1.
I don't think it is the root cause of the difference.
I think the difference is sys.getrefcount() itself that no longer increases reference count. It has nothing to do with fetch.
ajaust
left a comment
There was a problem hiding this comment.
Thanks for the feedback. I updated the comment and the commit message and added one fixup to move the new variable into the fetch method.
Python 3.14 changed how object reference counts work [1], often resulting in lower counts than before. In RefTrace, this reduces the internal trace reference count from 3 to 2 for objects that may be garbage collected. [1]: https://docs.python.org/3/whatsnew/3.14.html#optimizations
Fix RefTrace's garbage collection had to be adapted due Python 3.14's changes to object reference counting. I also enabled Python 3.14 as part of the wheels build again.