◐ Shell
clean mode source ↗

Message 329731 - Python tracker

I just want to add one more voice for allowing the status quo:

C, OCaml, SML, Haskell allow the assignment, Ruby disallows it.

The ML family must allow it, since "let (x) = 10" is pattern matching
under the hood, and (10) = 10.

In C (gcc, clang at least, I didn't check the standard) it may be convenience.


Python's assignment unpacking is similar to pattern matching, so
while the construct is surprising at first, I think it's the right
thing to do.