unpacking lists (there's more than one way to do it!)

Roy Smith roy at panix.com
Wed Jan 16 02:42:11 CET 2002

All of the following seem to have the same effect:

x, y = list
(x, y) = list
[x, y] = list

Is there any reason to prefer one over the other?  FWIW, I tend to write 
the last because I think it looks cleaner.

More information about the Python-list mailing list