mirror of https://github.com/python/cpython
bpo-44273: Improve syntax error message for assigning to "..." (GH-26477)
Use "ellipsis" instead of "Ellipsis" in syntax error messages to eliminate confusion with built-in variable Ellipsis.
This commit is contained in:
parent
fffa0f92ad
commit
39dd141a4b
|
@ -93,7 +93,7 @@ SyntaxError: cannot assign to literal here. Maybe you meant '==' instead of '='?
|
||||||
|
|
||||||
>>> ... = 1
|
>>> ... = 1
|
||||||
Traceback (most recent call last):
|
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
|
>>> `1` = 1
|
||||||
Traceback (most recent call last):
|
Traceback (most recent call last):
|
||||||
|
|
|
@ -217,7 +217,7 @@ _PyPegen_get_expr_name(expr_ty e)
|
||||||
return "True";
|
return "True";
|
||||||
}
|
}
|
||||||
if (value == Py_Ellipsis) {
|
if (value == Py_Ellipsis) {
|
||||||
return "Ellipsis";
|
return "ellipsis";
|
||||||
}
|
}
|
||||||
return "literal";
|
return "literal";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue