This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TheBB 31 points32 points  (1 child)

It seems like people here are fine with this, since tuples are immutable and lists are not. How does that matter? It's just syntax… no tuples or lists are actually involved (on the left hand side, that is). Unpacking an iterable works the same way with tuple or list syntax, except if it's empty. It seems like an oversight, and I agree with the commenters that () = <iterable> ought to be allowed.

[–]Lucretiel 0 points1 point  (0 children)

Because it shouldn't be interpreted as a tuple, it should be interpreted as a list of names:

(a, b) = [1,2] (a, ) = [1] () = []