-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-132346: Docs: Clarify that reference counts aren't stable between versions #132352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-132346: Docs: Clarify that reference counts aren't stable between versions #132352
Conversation
Doc/glossary.rst
Outdated
In :term:`CPython`, reference counts are not considered to be stable | ||
or well-defined values; the number of references to an object, and how | ||
that number is affected by Python code, may be different between | ||
versions. Consequently, don't rely on an object's reference count to be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last line is not true anymore with free-threading and interpreter skipping ref on temporaries, I suggest to remove the last line.
The lint CI is failing. |
Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…tween versions (pythonGH-132352) (cherry picked from commit 3dbe02c) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
…tween versions (pythonGH-132352) (cherry picked from commit 3dbe02c) Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
GH-136613 is a backport of this pull request to the 3.14 branch. |
GH-136614 is a backport of this pull request to the 3.13 branch. |
I noticed that
Py_REFCNT
andsys.getrefcount
both document this already, but not the "reference count" glossary term.📚 Documentation preview 📚: https://cpython-previews--132352.org.readthedocs.build/en/132352/glossary.html#term-reference-count