mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
bpo-40067: Improve error messages for multiple star expressions in assignments (GH-19168)
Co-Authored-By: Batuhan Taşkaya <isidentical@gmail.com> Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
5c3cda0d1a
commit
cb6534e1a8
4 changed files with 11 additions and 3 deletions
|
|
@ -308,12 +308,17 @@
|
|||
>>> a, *b, c, *d, e = range(10) # doctest:+ELLIPSIS
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
SyntaxError: two starred expressions in assignment
|
||||
SyntaxError: multiple starred expressions in assignment
|
||||
|
||||
>>> [*b, *c] = range(10) # doctest:+ELLIPSIS
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
SyntaxError: two starred expressions in assignment
|
||||
SyntaxError: multiple starred expressions in assignment
|
||||
|
||||
>>> a,*b,*c,*d = range(4) # doctest:+ELLIPSIS
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
SyntaxError: multiple starred expressions in assignment
|
||||
|
||||
>>> *a = range(10) # doctest:+ELLIPSIS
|
||||
Traceback (most recent call last):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue