[Python-Dev] Half-baked proposal: * (and **?) in assignments

Martin v. Loewis martin@v.loewis.de
23 Nov 2002 10:25:35 +0100


Brian Quinlan <brian@sweetapp.com> writes:

> Need is a bit too strong. But which do you like better:
> 
> year, month, day = time.localtime()[0:3]
> 
> or 
> 
> year, month, day, *dummy = time.localtime()

lttime = time.localtime()
year = ltime.tm_year
month = ltime.tm_mon
day = ltime.tm_mday

Readability counts.

Actually, you may just avoid the assignments altogether, and just use
the named fields.

Regards,
Martin