summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/bool.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/bool.rst')
-rw-r--r--Doc/c-api/bool.rst25
1 files changed, 14 insertions, 11 deletions
diff --git a/Doc/c-api/bool.rst b/Doc/c-api/bool.rst
index c197d44..b2d8f21 100644
--- a/Doc/c-api/bool.rst
+++ b/Doc/c-api/bool.rst
@@ -6,7 +6,7 @@ Boolean Objects
---------------
Booleans in Python are implemented as a subclass of integers. There are only
-two booleans, :const:`Py_False` and :const:`Py_True`. As such, the normal
+two booleans, :c:data:`Py_False` and :c:data:`Py_True`. As such, the normal
creation and deletion functions don't apply to booleans. The following macros
are available, however.
@@ -19,29 +19,32 @@ are available, however.
.. c:var:: PyObject* Py_False
- The Python ``False`` object. This object has no methods. It needs to be
- treated just like any other object with respect to reference counts.
+ The Python ``False`` object. This object has no methods and is
+ `immortal <https://peps.python.org/pep-0683/>`_.
+
+.. versionchanged:: 3.12
+ :c:data:`Py_False` is immortal.
.. c:var:: PyObject* Py_True
- The Python ``True`` object. This object has no methods. It needs to be treated
- just like any other object with respect to reference counts.
+ The Python ``True`` object. This object has no methods and is
+ `immortal <https://peps.python.org/pep-0683/>`_.
+
+.. versionchanged:: 3.12
+ :c:data:`Py_True` is immortal.
.. c:macro:: Py_RETURN_FALSE
- Return :const:`Py_False` from a function, properly incrementing its reference
- count.
+ Return :c:data:`Py_False` from a function.
.. c:macro:: Py_RETURN_TRUE
- Return :const:`Py_True` from a function, properly incrementing its reference
- count.
+ Return :c:data:`Py_True` from a function.
.. c:function:: PyObject* PyBool_FromLong(long v)
- Return a new reference to :const:`Py_True` or :const:`Py_False` depending on the
- truth value of *v*.
+ Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value of *v*.