diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-07-15 04:05:59 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-07-15 04:05:59 (GMT) |
commit | eda29306b34303af2b79366c12f54a223029c165 (patch) | |
tree | 1215e26d073dba84614c4355d3335b852a3f0bf6 /Doc/api | |
parent | 89ba1fff170f9e5de6f8c9c4ad598931c69492e8 (diff) | |
download | cpython-eda29306b34303af2b79366c12f54a223029c165.zip cpython-eda29306b34303af2b79366c12f54a223029c165.tar.gz cpython-eda29306b34303af2b79366c12f54a223029c165.tar.bz2 |
Formalize that the Py_VISIT macro requires that the tp_traverse
implementation it's used in must give its arguments specific names.
Diffstat (limited to 'Doc/api')
-rw-r--r-- | Doc/api/newtypes.tex | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/api/newtypes.tex b/Doc/api/newtypes.tex index 2b58cd9..deb4ac1 100644 --- a/Doc/api/newtypes.tex +++ b/Doc/api/newtypes.tex @@ -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 |