Skip to content

Commit 567682c

Browse files
updated Sphinx references
1 parent 8604993 commit 567682c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Doc/extending/extending.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,10 +1085,10 @@ the original item 1. Now let's suppose the original item 1 was an instance of a
10851085
user-defined class, and let's further suppose that the class defined a
10861086
:meth:`!__del__` method. If this class instance has a reference count of 1,
10871087
disposing of it will call its :meth:`!__del__` method. Internally,
1088-
:c:func:`PyList_SetItem` calls :c:func:`Py_XDECREF` on the replaced item,
1089-
which invokes the object's ``tp_dealloc`` function (``subtype_dealloc`` for Python
1090-
class instances). During deallocation, ``subtype_dealloc`` calls ``tp_finalize``,
1091-
which is mapped to the ``__del__`` method for Python classes (see :pep:`442`).
1088+
:c:func:`PyList_SetItem` calls :c:func:`Py_DECREF` on the replaced item,
1089+
which invokes replaced item's corrresponding :c:member:`~PyTypeObject.tp_dealloc` function (i.e :c:func:`subtype_dealloc` in case of Python
1090+
class instance). During deallocation, :c:func:`subtype_dealloc` calls :c:member:`~PyTypeObject.tp_finalize`,
1091+
which is mapped to the :meth:`!__del__` method for class instances (see :pep:`442`).
10921092
This entire sequence happens synchronously within the :c:func:`PyList_SetItem` call.
10931093

10941094
Since it is written in Python, the :meth:`!__del__` method can execute arbitrary

0 commit comments

Comments
 (0)