diff --git a/Doc/c-api/bool.rst b/Doc/c-api/bool.rst index c197d447e9618c9..097ac66f3097b38 100644 --- a/Doc/c-api/bool.rst +++ b/Doc/c-api/bool.rst @@ -19,29 +19,30 @@ 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. + +.. versionchanged:: 3.12 + :const:`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. + +.. versionchanged:: 3.12 + :const:`Py_True` is immortal. .. c:macro:: Py_RETURN_FALSE - Return :const:`Py_False` from a function, properly incrementing its reference - count. + Return :const:`Py_False` from a function. .. c:macro:: Py_RETURN_TRUE - Return :const:`Py_True` from a function, properly incrementing its reference - count. + Return :const:`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 :const:`Py_True` or :const:`Py_False`, depending on the truth value of *v*. diff --git a/Doc/c-api/none.rst b/Doc/c-api/none.rst index b84a16a28ead566..e245d0babd998eb 100644 --- a/Doc/c-api/none.rst +++ b/Doc/c-api/none.rst @@ -16,11 +16,10 @@ same reason. .. c:var:: PyObject* Py_None The Python ``None`` object, denoting lack of value. This object has no methods. - It needs to be treated just like any other object with respect to reference - counts. +.. versionchanged:: 3.12 + :const:`Py_None` is immortal. .. c:macro:: Py_RETURN_NONE - Properly handle returning :c:data:`Py_None` from within a C function (that is, - increment the reference count of ``None`` and return it.) + Return :c:data:`Py_None` from within a C function. diff --git a/Doc/c-api/slice.rst b/Doc/c-api/slice.rst index 8271d9acfb645e1..176192ef98168c6 100644 --- a/Doc/c-api/slice.rst +++ b/Doc/c-api/slice.rst @@ -118,6 +118,8 @@ Ellipsis Object .. c:var:: PyObject *Py_Ellipsis - The Python ``Ellipsis`` object. This object has no methods. It needs to be - treated just like any other object with respect to reference counts. Like - :c:data:`Py_None` it is a singleton object. + The Python ``Ellipsis`` object. This object has no methods. Like + :c:data:`Py_None` it is an immortal singleton object. + + .. versionchanged:: 3.12 + :const:`Py_Ellipsis` is immortal.