3 ms·
I don't see how that demonstrates anything about the order of the assignment. It seems to show that node and blue_node are no longer the same object? (I'm not s
by jessaustin 8y ago
I don't see how that demonstrates anything about the order of the assignment. It seems to show that node and blue_node are no longer the same object? (I'm not sure I understand how that came to be either, but perhaps it's due to the PEP...) I'm not saying your general point is wrong, just that the REPL listing doesn't demonstrate your general point.
- jwilk 8y ago"node" is initially blue, and then you do: node = node.next = red_node If assignments were right-to-left, the .next attribute would be set on the blue node. If they were left-to-right, it would be added to the red node. The AttributeError exception shows it is the latter order.
- fractalb 8y agoIt doesn't say anything about the order of assignment. It just shows that `node.next` wasn't evaluated to anything. `node.next` needs to be evaluated before doing any assignments
- jjnoakes 8y agoSure it does. Write out the example with both orders of assignments (convert it to single assignments only) and run it both ways.