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:
Serhiy Storchaka
2022-12-03 21:52:21 +02:00
committed by GitHub
parent c68573b339
commit a87c46eab3
52 changed files with 297 additions and 302 deletions

View File

@@ -235,7 +235,7 @@ winconsoleio_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
_io._WindowsConsoleIO.__init__
file as nameobj: object
mode: str = "r"
closefd: bool(accept={int}) = True
closefd: bool = True
opener: object = None
Open a console buffer by file descriptor.
@@ -249,7 +249,7 @@ static int
_io__WindowsConsoleIO___init___impl(winconsoleio *self, PyObject *nameobj,
const char *mode, int closefd,
PyObject *opener)
/*[clinic end generated code: output=3fd9cbcdd8d95429 input=06ae4b863c63244b]*/
/*[clinic end generated code: output=3fd9cbcdd8d95429 input=7a3eed6bbe998fd9]*/
{
const char *s;
wchar_t *name = NULL;