summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/arg.rst
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2012-05-05 23:54:29 (GMT)
committerLarry Hastings <larry@hastings.org>2012-05-05 23:54:29 (GMT)
commitfaf91e75ab287ae6c377b05b7eb91d7f5274fbc5 (patch)
tree5fd9ed01b383d818d84091f91efa22ce48b1bccb /Doc/c-api/arg.rst
parent6b03f2ce45785190c6a8da271199ff724ba559d8 (diff)
downloadcpython-faf91e75ab287ae6c377b05b7eb91d7f5274fbc5.zip
cpython-faf91e75ab287ae6c377b05b7eb91d7f5274fbc5.tar.gz
cpython-faf91e75ab287ae6c377b05b7eb91d7f5274fbc5.tar.bz2
Issue #14705: Add 'p' format character to PyArg_ParseTuple* for bool support.
Diffstat (limited to 'Doc/c-api/arg.rst')
-rw-r--r--Doc/c-api/arg.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/c-api/arg.rst b/Doc/c-api/arg.rst
index f33714e..2bcbbad 100644
--- a/Doc/c-api/arg.rst
+++ b/Doc/c-api/arg.rst
@@ -317,6 +317,15 @@ Other objects
.. versionchanged:: 3.1
``Py_CLEANUP_SUPPORTED`` was added.
+``p`` (:class:`bool`) [int]
+ Tests the value passed in for truth (a boolean **p**\redicate) and converts
+ the result to its equivalent C true/false integer value.
+ Sets the int to 1 if the expression was true and 0 if it was false.
+ This accepts any valid Python value. See :ref:`truth` for more
+ information about how Python tests values for truth.
+
+ .. versionchanged:: 3.3
+
``(items)`` (:class:`tuple`) [*matching-items*]
The object must be a Python sequence whose length is the number of format units
in *items*. The C arguments must correspond to the individual format units in