anonymous assignment

Yves Dorfsman yves at zioup.com
Sun May 11 22:28:13 EDT 2008


Is there anyway to tell python I don't care about a value ?

Say I want today's year and day, I'd like to do something like:

import time
y, None, d, None, None, None, None = time.localtime()

I know you can't assign anything to None, but I'm sure you get what I mean, 
a special keyword that means I don't care about this value. In this 
particular case, there's got to be a better way than:

d = time.local()
y = d[0]
d = d[1]



Thanks.


Yves.
http://www.SollerS.ca



More information about the Python-list mailing list