mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-98154: Clarify Usage of "Reference Count" In the Docs (gh-107552)
PEP 683 (immortal objects) revealed some ways in which the Python documentation has been unnecessarily coupled to the implementation details of reference counts. In the end users should focus on reference ownership, including taking references and releasing them, rather than on how many reference counts an object has. This change updates the documentation to reflect that perspective. It also updates the docs relative to immortal objects in a handful of places.
This commit is contained in:
parent
0191af97a6
commit
5dc825d504
15 changed files with 162 additions and 90 deletions
|
@ -546,7 +546,7 @@ state:
|
|||
.. note::
|
||||
|
||||
Unlike other functions that steal references, ``PyModule_AddObject()``
|
||||
only decrements the reference count of *value* **on success**.
|
||||
only releases the reference to *value* **on success**.
|
||||
|
||||
This means that its return value must be checked, and calling code must
|
||||
:c:func:`Py_XDECREF` *value* manually on error.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue