File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1085,10 +1085,10 @@ the original item 1. Now let's suppose the original item 1 was an instance of a
10851085user-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,
10871087disposing 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 `).
10921092This entire sequence happens synchronously within the :c:func: `PyList_SetItem ` call.
10931093
10941094Since it is written in Python, the :meth: `!__del__ ` method can execute arbitrary
You can’t perform that action at this time.
0 commit comments