mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Formalize that the Py_VISIT macro requires that the tp_traverse
implementation it's used in must give its arguments specific names.
This commit is contained in:
parent
89ba1fff17
commit
eda29306b3
3 changed files with 49 additions and 39 deletions
|
@ -1664,13 +1664,14 @@ The \member{tp_traverse} handler must have the following type:
|
|||
\end{ctypedesc}
|
||||
|
||||
To simplify writing \member{tp_traverse} handlers, a
|
||||
\cfunction{Py_VISIT()} is provided:
|
||||
\cfunction{Py_VISIT()} macro is provided. In order to use this macro,
|
||||
the \member{tp_traverse} implementation must name its arguments
|
||||
exactly \var{visit} and \var{arg}:
|
||||
|
||||
\begin{cfuncdesc}{void}{Py_VISIT}{PyObject *o}
|
||||
Call the \var{visit} for \var{o} with \var{arg}. If \var{visit}
|
||||
returns a non-zero value, then return it. Using this macro,
|
||||
\member{tp_traverse} handlers look like:
|
||||
|
||||
Call the \var{visit} callback, with arguments \var{o} and \var{arg}.
|
||||
If \var{visit} returns a non-zero value, then return it. Using this
|
||||
macro, \member{tp_traverse} handlers look like:
|
||||
|
||||
\begin{verbatim}
|
||||
static int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue