The PEP is here: https://www.python.org/dev/peps/pep-0572/
"This is a proposal for creating a way to assign to variables within an expression using the notation NAME := expr."
replies(3):
"This is a proposal for creating a way to assign to variables within an expression using the notation NAME := expr."
This comment is false. It should say
x = y = z = 0 # Equivalent: (z := (y := (x := 0)))
"...assigns the single resulting object to each of the target lists, from left to right." https://docs.python.org/3/reference/simple_stmts.html#assign...Here is a demonstration of the difference:
>>> class Node: pass
...
>>> node = blue_node = Node()
>>> red_node = Node()
>>> node = node.next = red_node
>>> blue_node.next is red_node
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: Node instance has no attribute 'next'