Skip to content

Commit 15a0b57

Browse files
Commit
1 parent 025a213 commit 15a0b57

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

Lib/test/test_unpack_ex.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -319,27 +319,27 @@
319319
...
320320
test.test_unpack_ex.BozoError
321321
322-
Now some general starred expressions (all fail).
322+
Now some general starred targets/expressions (all fail).
323323
324324
>>> a, *b, c, *d, e = range(10) # doctest:+ELLIPSIS
325325
Traceback (most recent call last):
326326
...
327-
SyntaxError: multiple starred expressions in assignment
327+
SyntaxError: multiple starred targets in assignment
328328
329329
>>> [*b, *c] = range(10) # doctest:+ELLIPSIS
330330
Traceback (most recent call last):
331331
...
332-
SyntaxError: multiple starred expressions in assignment
332+
SyntaxError: multiple starred targets in assignment
333333
334334
>>> a,*b,*c,*d = range(4) # doctest:+ELLIPSIS
335335
Traceback (most recent call last):
336336
...
337-
SyntaxError: multiple starred expressions in assignment
337+
SyntaxError: multiple starred targets in assignment
338338
339339
>>> *a = range(10) # doctest:+ELLIPSIS
340340
Traceback (most recent call last):
341341
...
342-
SyntaxError: starred assignment target must be in a list or tuple
342+
SyntaxError: starred target must be in a list or tuple
343343
344344
>>> *a # doctest:+ELLIPSIS
345345
Traceback (most recent call last):
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Error messages incorrectly using the term "starred expression" have been
2+
corrected.

Python/codegen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3415,7 +3415,7 @@ unpack_helper(compiler *c, location loc, asdl_expr_seq *elts)
34153415
}
34163416
else if (elt->kind == Starred_kind) {
34173417
return _PyCompile_Error(c, loc,
3418-
"multiple starred expressions in assignment");
3418+
"multiple starred targets in assignment");
34193419
}
34203420
}
34213421
if (!seen_star) {
@@ -5289,7 +5289,7 @@ codegen_visit_expr(compiler *c, expr_ty e)
52895289
/* In all legitimate cases, the Starred node was already replaced
52905290
* by codegen_list/codegen_tuple. XXX: is that okay? */
52915291
return _PyCompile_Error(c, loc,
5292-
"starred assignment target must be in a list or tuple");
5292+
"starred target must be in a list or tuple");
52935293
default:
52945294
return _PyCompile_Error(c, loc,
52955295
"can't use starred expression here");

0 commit comments

Comments
 (0)