Closed
Description
Feature or enhancement
Right now the syntax error is not very clear:
I propose to instead use something like:
@JelleZijlstra suggested to use similar error messages to :=
case, where we also only expect a name:
>>> (a.b := 3)
File "<unknown>", line 1
(a.b := 3)
^^^
SyntaxError: cannot use assignment expressions with attribute
>>> (a[0] := 3)
File "<unknown>", line 1
(a[0] := 3)
^^^^
SyntaxError: cannot use assignment expressions with subscript
>>> ((a, b) := 3)
File "<unknown>", line 1
((a, b) := 3)
^^^^^^
SyntaxError: cannot use assignment expressions with tuple
I am working on this right now :)