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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 297 additions and 302 deletions

View file

@ -739,10 +739,6 @@ class TestBasicOps(unittest.TestCase):
c.__setstate__((tuple('defg'), 0))
take(20, c)
# The second argument in the setstate tuple must be an int
with self.assertRaises(TypeError):
cycle('defg').__setstate__((list('abcdefg'), 'x'))
self.assertRaises(TypeError, cycle('').__setstate__, ())
self.assertRaises(TypeError, cycle('').__setstate__, ([],))