Skip to content

Commit 3759ac7

Browse files
committed
Re-write comment about mission of "PyObject *parent"
As suggested by @picnixz
1 parent 4470cea commit 3759ac7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Modules/pyexpat.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,15 @@ typedef struct {
7676
PyObject_HEAD
7777

7878
XML_Parser itself;
79-
PyObject *parent; /* Parent xmlparseobject (for ref counting) */
79+
/*
80+
* Strong reference to a parent `xmlparseobject` if this parser
81+
* is a child parser. Set to NULL if this parser is a root parser.
82+
* This is needed to keep the parent parser alive as long as it has
83+
* at least one child parser.
84+
*
85+
* See https://github.com/python/cpython/issues/139400 for details.
86+
*/
87+
PyObject *parent;
8088
int ordered_attributes; /* Return attributes as a list. */
8189
int specified_attributes; /* Report only specified attributes. */
8290
int in_callback; /* Is a callback active? */

0 commit comments

Comments
 (0)