Skip to content

Commit f951098

Browse files
Update Doc/extending/reference-counting.rst
Co-authored-by: Petr Viktorin <encukou@gmail.com>
1 parent 182d190 commit f951098

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Doc/extending/reference-counting.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ in the C API:
100100
In the ``spam_system`` function, ``self`` and ``arg`` are borrowed references
101101
(meaning we must not decrement their reference count), but ``result`` is a
102102
strong reference. ``result`` is returned, so the strong reference is given to
103-
the caller. This is also called "stealing" a reference (so, in the above
104-
example, the caller steals our strong reference to ``result``).
103+
the caller.
104+
The caller is now responsible for making sure :c:macro:`Py_DECREF` is called --
105+
either by calling it, or by delegating this responsibility.
105106

106107

107108
Reference counting patterns

0 commit comments

Comments
 (0)