[New-bugs-announce] [issue44278] Improve syntax error message for assigning to "..."
Serhiy Storchaka
report at bugs.python.org
Tue Jun 1 06:36:54 EDT 2021
New submission from Serhiy Storchaka <storchaka+cpython at gmail.com>:
Some users can be confused by syntax error message for assigning to ellipsis [1]:
>>> ... = 1
File "<stdin>", line 1
... = 1
^^^
SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='?
because Ellipsis is a name of a builtin variable Ellipsis, and it is possible to assign to variable named Ellipsis.
>>> Ellipsis = 1
>>> Ellipsis
1
I think that using lowercase spelling of "ellipsis" will eliminate confusion.
[1] https://mail.python.org/archives/list/python-ideas@python.org/thread/KDQ3OHALLXVZJIGPC4BMPVS2XH3VFPJV/
----------
components: Interpreter Core
messages: 394849
nosy: pablogsal, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Improve syntax error message for assigning to "..."
type: enhancement
versions: Python 3.11
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44278>
_______________________________________
More information about the New-bugs-announce
mailing list