Skip to content

Commit 3283bf4

Browse files
[3.10] bpo-44273: Improve syntax error message for assigning to "..." (GH-26477) (GH-26478)
Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis. (cherry picked from commit 39dd141) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 976598d commit 3283bf4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Lib/test/test_syntax.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
9494
>>> ... = 1
9595
Traceback (most recent call last):
96-
SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='?
96+
SyntaxError: cannot assign to ellipsis here. Maybe you meant '==' instead of '='?
9797
9898
>>> `1` = 1
9999
Traceback (most recent call last):

Parser/pegen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ _PyPegen_get_expr_name(expr_ty e)
217217
return "True";
218218
}
219219
if (value == Py_Ellipsis) {
220-
return "Ellipsis";
220+
return "ellipsis";
221221
}
222222
return "literal";
223223
}

0 commit comments

Comments
 (0)