mirror of
https://github.com/python/cpython.git
synced 2025-08-03 00:23:06 +00:00
[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 <storchaka@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
976598d36b
commit
3283bf4519
2 changed files with 2 additions and 2 deletions
|
@ -93,7 +93,7 @@ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
|
|||
|
||||
>>> ... = 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):
|
||||
|
|
|
@ -217,7 +217,7 @@ _PyPegen_get_expr_name(expr_ty e)
|
|||
return "True";
|
||||
}
|
||||
if (value == Py_Ellipsis) {
|
||||
return "Ellipsis";
|
||||
return "ellipsis";
|
||||
}
|
||||
return "literal";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue