8000 gh-132346: Docs: Clarify that reference counts aren't stable between versions by ZeroIntensity · Pull Request #132352 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 5 commits into from
Jul 13, 2025

Conversation

ZeroIntensity
Copy link
Member
@ZeroIntensity ZeroIntensity commented Apr 10, 2025

I noticed that Py_REFCNT and sys.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

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
Copy link
Contributor

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.

@kumaraditya303
Copy link
Contributor

The lint CI is failing.

@ZeroIntensity ZeroIntensity merged commit 3dbe02c into python:main Jul 13, 2025
30 checks passed
@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Jul 13, 2025
@ZeroIntensity ZeroIntensity deleted the clarify-reference-count branch July 13, 2025 09:10
@ZeroIntensity ZeroIntensity added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Jul 13, 2025
@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @ZeroIntensity for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 13, 2025
…tween versions (pythonGH-132352)

(cherry picked from commit 3dbe02c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 13, 2025
…tween versions (pythonGH-132352)

(cherry picked from commit 3dbe02c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
@bedevere-app
Copy link
bedevere-app bot commented Jul 13, 2025

GH-136613 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jul 13, 2025
@bedevere-app
Copy link
bedevere-app bot commented Jul 13, 2025

GH-136614 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 13, 2025
ZeroIntensity added a commit that referenced this pull request Jul 13, 2025
…etween versions (GH-132352) (GH-136613)

gh-132346: Docs: Clarify that reference counts aren't stable between versions (GH-132352)
(cherry picked from commit 3dbe02c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
ZeroIntensity added a commit that referenced this pull request Jul 13, 2025
…etween versions (GH-132352) (GH-136614)

gh-132346: Docs: Clarify that reference counts aren't stable between versions (GH-132352)
(cherry picked from commit 3dbe02c)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
picnixz pushed a commit to picnixz/cpython that referenced this pull request Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants
0