Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3332778

Browse files
committed
Corrected a section reference (title was wrong).
Added information on the return values of PyArg_ParseTuple() and PyArg_ParseTupleAndKeywords().
1 parent 88fdaa7 commit 3332778

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

Doc/ext/ext.tex

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ \section{Calling Python Functions from C
547547
\constant{METH_VARARGS} flag; this is described in section
548548
\ref{methodTable}, ``The Module's Method Table and Initialization
549549
Function.'' The \cfunction{PyArg_ParseTuple()} function and its
550-
arguments are documented in section \ref{parseTuple}, ``Format Strings
551-
for \cfunction{PyArg_ParseTuple()}.''
550+
arguments are documented in section \ref{parseTuple}, ``Extracting
551+
Parameters in Extension Functions.''
552552

553553
The macros \cfunction{Py_XINCREF()} and \cfunction{Py_XDECREF()}
554554
increment/decrement the reference count of an object and are safe in
@@ -651,7 +651,8 @@ \section{Extracting Parameters in Extension Functions
651651
remaining arguments must be addresses of variables whose type is
652652
determined by the format string. For the conversion to succeed, the
653653
\var{arg} object must match the format and the format must be
654-
exhausted.
654+
exhausted. On success, \cfunction{PyArg_ParseTuple()} returns true,
655+
otherwise it returns false and raises an appropriate exception.
655656

656657
Note that while \cfunction{PyArg_ParseTuple()} checks that the Python
657658
arguments have the required types, it cannot check the validity of the
@@ -986,10 +987,12 @@ \section{Keyword Parameters for Extension Functions
986987

987988
The \var{arg} and \var{format} parameters are identical to those of the
988989
\cfunction{PyArg_ParseTuple()} function. The \var{kwdict} parameter
989-
is the dictionary of keywords received as the third parameter from the
990+
is the dictionary of keywords received as the third parameter from the
990991
Python runtime. The \var{kwlist} parameter is a \NULL{}-terminated
991992
list of strings which identify the parameters; the names are matched
992-
with the type information from \var{format} from left to right.
993+
with the type information from \var{format} from left to right. On
994+
success, \cfunction{PyArg_ParseTupleAndKeywords()} returns true,
995+
otherwise it returns false and raises an appropriate exception.
993996

994997
\strong{Note:} Nested tuples cannot be parsed when using keyword
995998
arguments! Keyword parameters passed in which are not present in the

0 commit comments

Comments
 (0)