document Py_VISIT as a macro in the docs (#133688)

This commit is contained in:
da-woods 2025-05-18 17:28:43 +01:00 committed by GitHub
parent 2cc99b3dd3
commit bb32f3c698
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -180,9 +180,9 @@ provided. In order to use this macro, the :c:member:`~PyTypeObject.tp_traverse`
must name its arguments exactly *visit* and *arg*:
.. c:function:: void Py_VISIT(PyObject *o)
.. c:macro:: Py_VISIT(o)
If *o* is not ``NULL``, call the *visit* callback, with arguments *o*
If the :c:expr:`PyObject *` *o* is not ``NULL``, call the *visit* callback, with arguments *o*
and *arg*. If *visit* returns a non-zero value, then return it.
Using this macro, :c:member:`~PyTypeObject.tp_traverse` handlers
look like::