[New-bugs-announce] [issue44273] Assigning to Ellipsis should be the same as assigning to __debug__
Andre Roberge
report at bugs.python.org
Mon May 31 11:04:05 EDT 2021
New submission from Andre Roberge <andre.roberge at gmail.com>:
Consider the following in Python 3.10
>>> ... = 1
File "<stdin>", line 1
... = 1
^^^
SyntaxError: cannot assign to Ellipsis here. Maybe you meant '==' instead of '='?
>>> __debug__ = 1
File "<stdin>", line 1
SyntaxError: cannot assign to __debug__
In prior Python versions, assignments to Ellisis written as ... were treated the same as assignment to __debug__. I believe that the old message was a better choice.
The error message about assigning to Ellipsis (...) is made even more confusing since Ellipsis (the name) can be assigned to a different value.
>>> ... == Ellipsis
True
>>> Ellipsis = 1
>>> ... == Ellipsis
False
>>> ...
Ellipsis
----------
components: Interpreter Core
messages: 394808
nosy: aroberge
priority: normal
severity: normal
status: open
title: Assigning to Ellipsis should be the same as assigning to __debug__
versions: Python 3.10
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44273>
_______________________________________
More information about the New-bugs-announce
mailing list