mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
As discussed on python-dev, changed builtin.zip() to handle zero arguments
by returning an empty list instead of raising a TypeError.
This commit is contained in:
parent
9463792c68
commit
eaef615116
5 changed files with 20 additions and 11 deletions
|
@ -1126,7 +1126,8 @@ class BuiltinTest(unittest.TestCase):
|
|||
if i < 0 or i > 2: raise IndexError
|
||||
return i + 4
|
||||
self.assertEqual(zip(a, I()), t)
|
||||
self.assertRaises(TypeError, zip)
|
||||
self.assertEqual(zip(), [])
|
||||
self.assertEqual(zip(*[]), [])
|
||||
self.assertRaises(TypeError, zip, None)
|
||||
class G:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue