summaryrefslogtreecommitdiff
path: root/Include/object.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-11-09 13:40:47 +0100
committerGitHub <noreply@github.com>2020-11-09 13:40:47 +0100
commit23c5f93b83f78f295313e137011edb18b24c37c2 (patch)
tree38cc104221c9e283bdb81f9511abe4fced97d67d /Include/object.h
parenta117167d8dc8fa673a4646f509551c7950f824e5 (diff)
downloadcpython-git-23c5f93b83f78f295313e137011edb18b24c37c2.tar.gz
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 'Include/object.h')
-rw-r--r--Include/object.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Include/object.h b/Include/object.h
index 835d9de01f..eab3228f3a 100644
--- a/Include/object.h
+++ b/Include/object.h
@@ -526,10 +526,11 @@ they can have object code that is not dependent on Python compilation flags.
PyAPI_FUNC(void) Py_IncRef(PyObject *);
PyAPI_FUNC(void) Py_DecRef(PyObject *);
-// Increment the reference count of the object and return the object.
+// Create a new strong reference to an object:
+// increment the reference count of the object and return the object.
PyAPI_FUNC(PyObject*) Py_NewRef(PyObject *obj);
-// Similar to Py_NewRef() but the object can be NULL.
+// Similar to Py_NewRef(), but the object can be NULL.
PyAPI_FUNC(PyObject*) Py_XNewRef(PyObject *obj);
static inline PyObject* _Py_NewRef(PyObject *obj)