[issue14705] Add 'bool' format character to PyArg_ParseTuple*

Raymond Hettinger report at bugs.python.org
Sun May 6 02:15:35 CEST 2012


Raymond Hettinger <raymond.hettinger at gmail.com> added the comment:

I would have expected a bool parse code to insist on a boolean, so that:

    int x;
    PyArg_ParseTupleAndKeywords(args, kwds, "p:func", &x);

would behave the same as:

    PyObject  *o;
    int x;
    PyArg_ParseTupleAndKeywords(args, kwds, "O!:func", &PyBool_Type, &o);
    x = o == Py_True;

----------
nosy: +rhettinger

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14705>
_______________________________________


More information about the Python-bugs-list mailing list