New submission from Pierre Quentel <[email protected]>:
In CPython 3.10 :
Python 3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 19:00:18) [MSC v.1929 64 bit
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> @x = 123
File "<stdin>", line 1
@x = 123
^^^^^^^
SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='?
but both suggestions lead to a SyntaxError :
>>> @x == 123
...
File "<stdin>", line 2
^
SyntaxError: invalid syntax
>>> @x := 123
...
File "<stdin>", line 2
^
SyntaxError: invalid syntax
>>>
Maybe an error message such as "cannot assign to decorator" would be more
appropriate ?
----------
components: Parser
messages: 406351
nosy: lys.nikolaou, pablogsal, quentel
priority: normal
severity: normal
status: open
title: Strange SyntaxError message / suggestions for "@x = 123"
type: enhancement
versions: Python 3.10
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue45807>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com