Skip to content

Commit a49ccf2

Browse files
committed
note that Py_VISIT handles NULL (closes python#27183)
1 parent 0a5120e commit a49ccf2

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Doc/c-api/gcsupport.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,10 @@ must name its arguments exactly *visit* and *arg*:
126126
127127
.. c:function:: void Py_VISIT(PyObject *o)
128128
129-
Call the *visit* callback, with arguments *o* and *arg*. If *visit* returns
130-
a non-zero value, then return it. Using this macro, :c:member:`~PyTypeObject.tp_traverse`
131-
handlers look like::
129+
If *o* is not *NULL*, call the *visit* callback, with arguments *o*
130+
and *arg*. If *visit* returns a non-zero value, then return it.
131+
Using this macro, :c:member:`~PyTypeObject.tp_traverse` handlers
132+
look like::
132133
133134
static int
134135
my_traverse(Noddy *self, visitproc visit, void *arg)

0 commit comments

Comments
 (0)