mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +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
|
@ -2314,7 +2314,7 @@ bytes_decode_impl(PyBytesObject *self, const char *encoding,
|
|||
/*[clinic input]
|
||||
bytes.splitlines
|
||||
|
||||
keepends: bool(accept={int}) = False
|
||||
keepends: bool = False
|
||||
|
||||
Return a list of the lines in the bytes, breaking at line boundaries.
|
||||
|
||||
|
@ -2324,7 +2324,7 @@ true.
|
|||
|
||||
static PyObject *
|
||||
bytes_splitlines_impl(PyBytesObject *self, int keepends)
|
||||
/*[clinic end generated code: output=3484149a5d880ffb input=a8b32eb01ff5a5ed]*/
|
||||
/*[clinic end generated code: output=3484149a5d880ffb input=5d7b898af2fe55c0]*/
|
||||
{
|
||||
return stringlib_splitlines(
|
||||
(PyObject*) self, PyBytes_AS_STRING(self),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue