On Mon, 12 May 2008 03:40:03 +0000, Yves Dorfsman wrote:

> Paul Rubin wrote:
>
>> You can just use a variable name than you ignore.  It's traditional to
>> use _ but it's not a special keyword, it's just a another variable
>> name:
>> 
>>    y, _, d, _, _, _, _, _, _ = time.localtime()
> 
> But you still have have a variable that's using memory for nothing. I
> find this unsatisfactory...

Get over it…

Or use `operator.itemgetter()`:

In [36]: operator.itemgetter(0, 2)(time.localtime())
Out[36]: (2008, 12)

:-)

Ciao,
        Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to