Skip to content

Commit 80f3fc3

Browse files
committed
Docs: Clarify that reference counts aren't stable between versions
1 parent 619edb8 commit 80f3fc3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/glossary.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,11 @@ Glossary
12021202
:func:`sys.getrefcount` function to return the
12031203
reference count for a particular object.
12041204

1205+
In :term:`CPython`, reference counts are not considered to be stable, well-defined
1206+
values for an object; the number of references to a Python object, and how that number
1207+
is affected by Python code, may be different between versions. Consequently, don't rely
1208+
on an object's reference count to be a value other than 0 or 1.
1209+
12051210
regular package
12061211
A traditional :term:`package`, such as a directory containing an
12071212
``__init__.py`` file.

0 commit comments

Comments
 (0)