[Python-checkins] r61226 - python/trunk/Doc/c-api/arg.rst

georg.brandl python-checkins at python.org
Tue Mar 4 08:33:30 CET 2008


Author: georg.brandl
Date: Tue Mar  4 08:33:30 2008
New Revision: 61226

Modified:
   python/trunk/Doc/c-api/arg.rst
Log:
#2230: document that PyArg_* leaves addresses alone on error.


Modified: python/trunk/Doc/c-api/arg.rst
==============================================================================
--- python/trunk/Doc/c-api/arg.rst	(original)
+++ python/trunk/Doc/c-api/arg.rst	Tue Mar  4 08:33:30 2008
@@ -208,7 +208,7 @@
    :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 @@
 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, ...)


More information about the Python-checkins mailing list