From 80f3fc3527d578bc8abfd18f07beb15849a93a47 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Thu, 10 Apr 2025 05:46:54 -0400 Subject: [PATCH 1/4] 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/4] 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 From 3403bce96789df52f363bf2c3ae6f2de8ccf91c3 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 13 Jul 2025 03:55:26 -0400 Subject: [PATCH 3/4] Remove last line --- Doc/glossary.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 9c604bbf89851d..a4248fc6bfc64c 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -1205,8 +1205,7 @@ Glossary 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. + versions. regular package A traditional :term:`package`, such as a directory containing an From 48b76625ea4649418380c1b23bf367a0e750abc4 Mon Sep 17 00:00:00 2001 From: Peter Bierma Date: Sun, 13 Jul 2025 04:45:57 -0400 Subject: [PATCH 4/4] Fix trailing whitespace. --- Doc/glossary.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/glossary.rst b/Doc/glossary.rst index a729e5cf15131a..199a917f9f101e 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -1211,7 +1211,7 @@ Glossary 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. + versions. regular package A traditional :term:`package`, such as a directory containing an