Discussion about this post

User's avatar
Vedran Čačić (Veky)'s avatar

The part about assignments is completely bogus. First, no, assignments don't return a value at all, they are not expressions but statements (walrus is a different thing, but it cannot be nested in this way). Python is not C.

But even if they were, Python semantics is opposite. Assignment targets are processed from left to right, which you can easily see by instrumenting setattr, in the same way you instrumented getting the value of b in part 3.

Expand full comment

No posts