This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve syntax error message for assigning to "..."
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Assigning to Ellipsis should be the same as assigning to __debug__
View: 44273
Assigned To: Nosy List: BTaskaya, pablogsal, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2021-06-01 10:36 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 26477 open serhiy.storchaka, 2021-06-01 10:41
Messages (2)
msg394849 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-06-01 10:36
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/
msg394851 - (view) Author: Batuhan Taskaya (BTaskaya) * (Python committer) Date: 2021-06-01 10:40
I think this is a duplicate of issue 44273.
History
Date User Action Args
2022-04-11 14:59:46adminsetgithub: 88444
2021-06-01 10:43:16serhiy.storchakasetstatus: open -> closed
superseder: Assigning to Ellipsis should be the same as assigning to __debug__
resolution: duplicate
stage: patch review -> resolved
2021-06-01 10:41:20serhiy.storchakasetversions: + Python 3.10
2021-06-01 10:41:06serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request25071
2021-06-01 10:40:47BTaskayasetnosy: + BTaskaya
messages: + msg394851
2021-06-01 10:36:54serhiy.storchakacreate