Skip to content
Merged
4 changes: 2 additions & 2 deletions Lib/test/test_unpack_ex.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,12 +308,12 @@
>>> a, *b, c, *d, e = range(10) # doctest:+ELLIPSIS
Traceback (most recent call last):
...
SyntaxError: two starred expressions in assignment
SyntaxError: more than one starred expressions in assignment
>>> [*b, *c] = range(10) # doctest:+ELLIPSIS
Traceback (most recent call last):
...
SyntaxError: two starred expressions in assignment
SyntaxError: more than one starred expressions in assignment
>>> *a = range(10) # doctest:+ELLIPSIS
Traceback (most recent call last):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
For multiple star expressions in an assignment, the error message improved.
Patch by Furkan Onder
2 changes: 1 addition & 1 deletion Python/compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -3708,7 +3708,7 @@ assignment_helper(struct compiler *c, asdl_seq *elts)
}
else if (elt->kind == Starred_kind) {
return compiler_error(c,
"two starred expressions in assignment");
"more than one starred expressions in assignment");
}
}
if (!seen_star) {
Expand Down