File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1086,10 +1086,13 @@ 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,
10871087disposing of it will call its :meth: `!__del__ ` method. Internally,
10881088: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 `).
1092- This entire sequence happens synchronously within the :c:func: `PyList_SetItem ` call.
1089+ which invokes replaced item's corrresponding
1090+ :c:member: `~PyTypeObject.tp_dealloc ` function (that is
1091+ :c:func: `subtype_dealloc ` in case of Python class instance). During
1092+ deallocation, :c:func: `subtype_dealloc ` calls
1093+ :c:member: `~PyTypeObject.tp_finalize `, which is mapped to the
1094+ :meth: `!__del__ ` method for class instances (see :pep: `442 `). This entire
1095+ sequence happens synchronously within the :c:func: `PyList_SetItem ` call.
10931096
10941097Since it is written in Python, the :meth: `!__del__ ` method can execute arbitrary
10951098Python code. Could it perhaps do something to invalidate the reference to
You can’t perform that action at this time.
0 commit comments