mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -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__, ([],))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue