mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Mention Py_RETURN_NONE when introducing the idiom of how to have a function
return Py_None.
This commit is contained in:
parent
ebd95222bf
commit
634893d1a3
1 changed files with 2 additions and 1 deletions
|
|
@ -290,7 +290,8 @@ are objects on the heap in Python!)
|
||||||
|
|
||||||
If you have a C function that returns no useful argument (a function
|
If you have a C function that returns no useful argument (a function
|
||||||
returning \ctype{void}), the corresponding Python function must return
|
returning \ctype{void}), the corresponding Python function must return
|
||||||
\code{None}. You need this idiom to do so:
|
\code{None}. You need this idiom to do so (which is implemented by the
|
||||||
|
\csimplemacro{Py_RETURN_NONE} macro):
|
||||||
|
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue