Issue #23275: Allow () = iterable assignment syntax

Documentation updates by Martin Panter.
This commit is contained in:
Berker Peksag 2016-05-18 08:44:29 +03:00
parent 93d22ecc7c
commit 094c9c921c
7 changed files with 41 additions and 41 deletions

View file

@ -117,6 +117,27 @@ error)
...
test.test_unpack.BozoError
Allow unpacking empty iterables
>>> () = []
>>> [] = ()
>>> [] = []
>>> () = ()
Unpacking non-iterables should raise TypeError
>>> () = 42
Traceback (most recent call last):
...
TypeError: 'int' object is not iterable
Unpacking to an empty iterable should raise ValueError
>>> () = [42]
Traceback (most recent call last):
...
ValueError: too many values to unpack (expected 0)
"""
__test__ = {'doctests' : doctests}