Mike Meyer wrote:
> Peter Hansen <[EMAIL PROTECTED]> writes:
>> Mike Meyer wrote:
>>> Yes. I once grabbed an old program that did assignments to None. But
>>> that's always been a bad idea.
>> What was the use case!?
> 
> Unpacking a tuple. Something like this:
> 
>           (foo, bar, None) = gen_tuple(stuff)

I tend to do:
   (foo, bar, _,_,_) = gen_tuple(stuff)

In cases where I decide I just want the bits I don't want. Aside from
anything else, if someone is testing things in the interactive prompt, it's
clear that the value is ephemeral, the fact it isn't name emphasises it's
unimportance and the repetition (in the above case) really makes it clear.
It also _looks_ like the value is thrown away as well.

And it doesn't clutter up your namespace...


Michael.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to