-
-
Notifications
You must be signed in to change notification settings - Fork 130
Description
Python 3.8's := operator has low precedence in resolves left-to-right, however there is anything at all left of := other than a name, it is always an error.
This makes expressions such as (a := b := c) impossible, requiring one to write (a := (b := c)) instead, which doesn't look as nice and requires more typing. It also mirrors the a = b = c statement that already exists in Python.
Coconut could be made to add the parentheses in for you, allowing such expressions - essentially resolving := right-to-left instead.
If := is also given higher precedence, it could allow expressions in the form (3 + a := b), currently accomplished by (3 + (a := b)), however I can see the argument that this kind of expression is harder to read without parentheses.