[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-07 Thread Paul Sokolovsky
Paul Sokolovsky added the comment: Thanks. I would like to put this ticket in the context of other grammar-related tickets/elaboration for the assignment operator: https://bugs.python.org/issue42316 - allow foo[a:=1] instead of foo[(a:=1)] https://bugs.python.org/issue42374 - allow (c := i f

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-07 Thread Paul Sokolovsky
Change by Paul Sokolovsky : -- nosy: +lys.nikolaou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: +0 I think this is with worth considering. Whenever the use case arises, the workaround is awkward. Code would be clearer if assignment expressions were liberalized to allow unpacking. The PEP aspired to avoid complex lvalues that might be hard to read

[issue43143] Allow multiple assignment (i.e. tuple on LHS) in walrus operator

2021-02-06 Thread Paul Sokolovsky
New submission from Paul Sokolovsky : Currently (CPython 3.10.0a4) having a tuple on left-hand side of assignment expression/operator (aka walrus operator) is not allowed: >>> ((a, b) := (1, 2)) File "", line 1 ((a, b) := (1, 2)) ^ SyntaxError: cannot use assignment expressions with