| ▲ | kccqzy 3 hours ago | |
An adjacent thread has some confusion about whether chained assignments happen left to right or right to left. Honestly that’s a factoid I don’t expect most Python programmers to know. It’s usually a bad idea to rely on people knowing arcade details of a language, especially a language like Python that has attracted many non-programmers like data scientists. (I have nothing against data scientists but their brainpower shouldn’t be wasted on remembering these kind of details.) | ||
| ▲ | js2 3 hours ago | parent [-] | |
I've been programming Python since 1.5.2 days and indeed, I didn't know the order of evaluation of chained assignments. That said, it's the self-referencing list in your example that's the more confusing part. It's atypical to have self-referencing data structures, so that's something I'd comment in the design if I needed one. | ||