mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +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
|
@ -12444,7 +12444,7 @@ unicode_rsplit_impl(PyObject *self, PyObject *sep, Py_ssize_t maxsplit)
|
|||
/*[clinic input]
|
||||
str.splitlines as unicode_splitlines
|
||||
|
||||
keepends: bool(accept={int}) = False
|
||||
keepends: bool = False
|
||||
|
||||
Return a list of the lines in the string, breaking at line boundaries.
|
||||
|
||||
|
@ -12454,7 +12454,7 @@ true.
|
|||
|
||||
static PyObject *
|
||||
unicode_splitlines_impl(PyObject *self, int keepends)
|
||||
/*[clinic end generated code: output=f664dcdad153ec40 input=b508e180459bdd8b]*/
|
||||
/*[clinic end generated code: output=f664dcdad153ec40 input=ba6ad05ee85d2b55]*/
|
||||
{
|
||||
return PyUnicode_Splitlines(self, keepends);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue