summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/weakref.rst
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-11-09 12:40:47 (GMT)
committerGitHub <noreply@github.com>2020-11-09 12:40:47 (GMT)
commit23c5f93b83f78f295313e137011edb18b24c37c2 (patch)
tree38cc104221c9e283bdb81f9511abe4fced97d67d /Doc/c-api/weakref.rst
parenta117167d8dc8fa673a4646f509551c7950f824e5 (diff)
downloadcpython-23c5f93b83f78f295313e137011edb18b24c37c2.zip
cpython-23c5f93b83f78f295313e137011edb18b24c37c2.tar.gz
cpython-23c5f93b83f78f295313e137011edb18b24c37c2.tar.bz2
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.
Diffstat (limited to 'Doc/c-api/weakref.rst')
-rw-r--r--Doc/c-api/weakref.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/c-api/weakref.rst b/Doc/c-api/weakref.rst
index e3a9bda..fb6628a 100644
--- a/Doc/c-api/weakref.rst
+++ b/Doc/c-api/weakref.rst
@@ -57,10 +57,10 @@ as much as it can.
.. note::
- This function returns a **borrowed reference** to the referenced object.
+ This function returns a :term:`borrowed reference` to the referenced object.
This means that you should always call :c:func:`Py_INCREF` on the object
- except if you know that it cannot be destroyed while you are still
- using it.
+ except it cannot be destroyed before the last usage of the borrowed
+ reference.
.. c:function:: PyObject* PyWeakref_GET_OBJECT(PyObject *ref)