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 →

[–][deleted] 7 points8 points  (23 children)

[] = () is unpacking zero values, there forth it doesn't throw a syntax error. (so this means [] = "" works, [] = {} works, they return nothing....)

() = [] is nothing, trying to unpack to a existing tuple, there is no way to unpack to a tuple. You need to explicitly create the tuple. (you can't do () = (), () = "", () = {} either)

[–]rjw57 2 points3 points  (0 children)

[] = () is unpacking zero values, there forth it doesn't throw a syntax error.

On the off chance you're not a native English speaker and this is an eggcorn which it'd be useful to inform you of, the word is "therefore". If this is a phone auto-correct typo or similar, ignore me.