----- Original Message -----
> From: "Joel Goldstick" <joel.goldst...@gmail.com>
> its called list unpacking or packing (?)
> 
> the right side is considered a tuple because of the commas
> >>> a = 1,2,3
> >>> a
> (1, 2, 3)
> >>> a[1]
> 2

To add to Joel's answer, the right side can be *any* sequence, and is not 
restricted to lists or tuples.

a, b, c = (x for x in range(3)) # a generator for instance

That would be a generator unpacking combined with a tuple packing (is packing 
restricted to tuples and lists ? probably)

JM


-- IMPORTANT NOTICE: 

The contents of this email and any attachments are confidential and may also be 
privileged. If you are not the intended recipient, please notify the sender 
immediately and do not disclose the contents to any other person, use it for 
any purpose, or store or copy the information in any medium. Thank you.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to