Issue #14705: Add 'p' format character to PyArg_ParseTuple* for bool support.

This commit is contained in:
Larry Hastings 2012-05-05 16:54:29 -07:00
parent 6b03f2ce45
commit faf91e75ab
4 changed files with 62 additions and 0 deletions

View file

@ -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