From a87c46eab3c306b1c5b8a072b7b30ac2c50651c0 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 3 Dec 2022 21:52:21 +0200 Subject: 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. --- Python/bltinmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Python/bltinmodule.c') diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index b3b7e8d6c50..ff96c25da5e 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -714,7 +714,7 @@ compile as builtin_compile filename: object(converter="PyUnicode_FSDecoder") mode: str flags: int = 0 - dont_inherit: bool(accept={int}) = False + dont_inherit: bool = False optimize: int = -1 * _feature_version as feature_version: int = -1 @@ -737,7 +737,7 @@ static PyObject * builtin_compile_impl(PyObject *module, PyObject *source, PyObject *filename, const char *mode, int flags, int dont_inherit, int optimize, int feature_version) -/*[clinic end generated code: output=b0c09c84f116d3d7 input=40171fb92c1d580d]*/ +/*[clinic end generated code: output=b0c09c84f116d3d7 input=cc78e20e7c7682ba]*/ { PyObject *source_copy; const char *str; -- cgit v1.2.3