mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
bpo-42294: Add borrowed/strong reference to doc glossary (GH-23206)
Add "borrowed reference" and "strong reference" to the documentation glossary. Enhance also Py_INCREF() and Py_NewRef() documentation.
This commit is contained in:
parent
a117167d8d
commit
23c5f93b83
11 changed files with 72 additions and 22 deletions
|
|
@ -326,7 +326,7 @@ when it's no longer needed---or passing on this responsibility (usually to its
|
|||
caller). When a function passes ownership of a reference on to its caller, the
|
||||
caller is said to receive a *new* reference. When no ownership is transferred,
|
||||
the caller is said to *borrow* the reference. Nothing needs to be done for a
|
||||
borrowed reference.
|
||||
:term:`borrowed reference`.
|
||||
|
||||
Conversely, when a calling function passes in a reference to an object, there
|
||||
are two possibilities: the function *steals* a reference to the object, or it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue