diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-08-11 13:41:56 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-11 13:41:56 (GMT) |
commit | 917439d4d9bebdb5d2792bb5bba095b821fdf003 (patch) | |
tree | 947ae2d838906fe65bffe18cbf52dffa54a23df3 /Doc/c-api/allocation.rst | |
parent | c32f0955b430ea5960fb293f8a6ff9263fc64e5c (diff) | |
download | cpython-917439d4d9bebdb5d2792bb5bba095b821fdf003.zip cpython-917439d4d9bebdb5d2792bb5bba095b821fdf003.tar.gz cpython-917439d4d9bebdb5d2792bb5bba095b821fdf003.tar.bz2 |
[3.10] gh-98154: Clarify Usage of "Reference Count" In the Docs (#107754)
Diffstat (limited to 'Doc/c-api/allocation.rst')
-rw-r--r-- | Doc/c-api/allocation.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Doc/c-api/allocation.rst b/Doc/c-api/allocation.rst index 0a8fcc5..231086c 100644 --- a/Doc/c-api/allocation.rst +++ b/Doc/c-api/allocation.rst @@ -31,9 +31,11 @@ Allocating Objects on the Heap Allocate a new Python object using the C structure type *TYPE* and the Python type object *type*. Fields not defined by the Python object header - are not initialized; the object's reference count will be one. The size of - the memory allocation is determined from the :c:member:`~PyTypeObject.tp_basicsize` field of - the type object. + are not initialized. + The caller will own the only reference to the object + (i.e. its reference count will be one). + The size of the memory allocation is determined from the + :c:member:`~PyTypeObject.tp_basicsize` field of the type object. .. c:function:: TYPE* PyObject_NewVar(TYPE, PyTypeObject *type, Py_ssize_t size) |