From 80f3fc3527d578bc8abfd18f07beb15849a93a47 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Thu, 10 Apr 2025 05:46:54 -0400 Subject: [PATCH 1/2] Docs: Clarify that reference counts aren't stable between versions --- Doc/glossary.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 0b26e18efd7f1b..29480cc8d500ba 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -1202,6 +1202,11 @@ Glossary :func:`sys.getrefcount` function to return the reference count for a particular object. + In :term:`CPython`, reference counts are not considered to be stable, well-defined + values for an object; the number of references to a Python 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 a value other than 0 or 1. + regular package A traditional :term:`package`, such as a directory containing an ``__init__.py`` file. From 3cc01bb4896d23987d97fdf4e4efe49104f9ada9 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Fri, 11 Apr 2025 07:36:29 -0400 Subject: [PATCH 2/2] Reword and reformat a little. --- Doc/glossary.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 29480cc8d500ba..9c604bbf89851d 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -1202,10 +1202,11 @@ Glossary :func:`sys.getrefcount` function to return the reference count for a particular object. - In :term:`CPython`, reference counts are not considered to be stable, well-defined - values for an object; the number of references to a Python 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 a value other than 0 or 1. + 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 + a value other than 0 or 1. regular package A traditional :term:`package`, such as a directory containing an