Skip to content

Commit 39dd141

Browse files
bpo-44273: Improve syntax error message for assigning to "..." (pythonGH-26477)
Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.
1 parent fffa0f9 commit 39dd141

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)