summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-03-04 07:33:30 (GMT)
committerGeorg Brandl <georg@python.org>2008-03-04 07:33:30 (GMT)
commitfd6cabfe21f4eeecd215d07c2d6d01309ef3dc3d (patch)
tree4a6460d2db2183ad82a6e41af465f0c54d2e4840 /Doc/c-api
parent27504dae1b6a0007d210e7e53a4519cd4f1793e1 (diff)
downloadcpython-fd6cabfe21f4eeecd215d07c2d6d01309ef3dc3d.zip
cpython-fd6cabfe21f4eeecd215d07c2d6d01309ef3dc3d.tar.gz
cpython-fd6cabfe21f4eeecd215d07c2d6d01309ef3dc3d.tar.bz2
#2230: document that PyArg_* leaves addresses alone on error.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/arg.rst12
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index 43d11d6..3deafdf 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -208,7 +208,7 @@ variable(s) whose address should be passed.
:ctype:`void\*` argument that was passed to the :cfunc:`PyArg_Parse\*` function.
The returned *status* should be ``1`` for a successful conversion and ``0`` if
the conversion has failed. When the conversion fails, the *converter* function
- should raise an exception.
+ should raise an exception and leave the content of *address* unmodified.
``S`` (string) [PyStringObject \*]
Like ``O`` but requires that the Python object is a string object. Raises
@@ -287,9 +287,13 @@ from the input tuple. There are a few cases, as described in the list of format
units above, where these parameters are used as input values; they should match
what is specified for the corresponding format unit in that case.
-For the conversion to succeed, the *arg* object must match the format and the
-format must be exhausted. On success, the :cfunc:`PyArg_Parse\*` functions
-return true, otherwise they return false and raise an appropriate exception.
+For the conversion to succeed, the *arg* object must match the format
+and the format must be exhausted. On success, the
+:cfunc:`PyArg_Parse\*` functions return true, otherwise they return
+false and raise an appropriate exception. When the
+:cfunc:`PyArg_Parse\*` functions fail due to conversion failure in one
+of the format units, the variables at the addresses corresponding to that
+and the following format units are left untouched.
.. cfunction:: int PyArg_ParseTuple(PyObject *args, const char *format, ...)