mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
bpo-15999: Accept arbitrary values for boolean parameters. (#15609)
builtins and extension module functions and methods that expect boolean values for parameters now accept any Python object rather than just a bool or int type. This is more consistent with how native Python code itself behaves.
This commit is contained in:
parent
c68573b339
commit
a87c46eab3
52 changed files with 297 additions and 302 deletions
|
|
@ -556,7 +556,7 @@ py_scanstring(PyObject* Py_UNUSED(self), PyObject *args)
|
|||
Py_ssize_t end;
|
||||
Py_ssize_t next_end = -1;
|
||||
int strict = 1;
|
||||
if (!PyArg_ParseTuple(args, "On|i:scanstring", &pystr, &end, &strict)) {
|
||||
if (!PyArg_ParseTuple(args, "On|p:scanstring", &pystr, &end, &strict)) {
|
||||
return NULL;
|
||||
}
|
||||
if (PyUnicode_Check(pystr)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue