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

Roy Smith roy at panix.com
Tue Jan 15 20:42:11 EST 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