gh-84436: update docs on Py_None/Py_True/Py_False/Py_Ellipsis becoming immortal (#105195)

This commit is contained in:
Irit Katriel 2023-06-21 21:13:25 +01:00 committed by GitHub
parent 4328dc6465
commit a2392720d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 19 deletions

View file

@ -15,12 +15,12 @@ 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.
The Python ``None`` object, denoting lack of value. This object has no methods
and is `immortal <https://peps.python.org/pep-0683/>`_.
.. versionchanged:: 3.12
:c:data:`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 a function.