A new to Python question

M.E.Farmer mefjr75 at hotmail.com
Sat May 14 19:11:16 EDT 2005


Ok I give up you have convinced me. Of what I am not sure ;)
Anyway I have always viewed :
a,b,c= (1,2,3)
as unpacking a tuple
and :
(a,b,c) = (1,2,3)
as creation of a tuple
It was a false assumption, I have used Python for years and have never
written an unpacking as:
(a,b,c) = (1,2,3)
I have always put parens around my tuples I always thought that a tuple
was a parens with at least one comma ;)
It is just not something I have done, it seems counter to my thinking ,
till I read from Bengt it is the commas that make the tuple not the
parens.
It all makes sense now, but if they are not needed I think they that
should be avoided for clarity.
Steve thanks for your time. I always learn a little from you ;)
M.E.Farmer




More information about the Python-list mailing list