Skip to content

Commit

Permalink
bpo-44273: Improve syntax error message for assigning to "..." (GH-26477
Browse files Browse the repository at this point in the history
)

Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.
  • Loading branch information
serhiy-storchaka committed Jun 1, 2021
1 parent fffa0f9 commit 39dd141
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lib/test/test_syntax.py
Expand Up @@ -93,7 +93,7 @@
>>> ... = 1
Traceback (most recent call last):
SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='?
SyntaxError: cannot assign to ellipsis here. Maybe you meant '==' instead of '='?
>>> `1` = 1
Traceback (most recent call last):
Expand Down
2 changes: 1 addition & 1 deletion Parser/pegen.c
Expand Up @@ -217,7 +217,7 @@ _PyPegen_get_expr_name(expr_ty e)
return "True";
}
if (value == Py_Ellipsis) {
return "Ellipsis";
return "ellipsis";
}
return "literal";
}
Expand Down

0 comments on commit 39dd141

Please sign in to comment.