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)

Goodness, that's bad form. I can just see someone copying it and doing:

(foo, bar, None) = gen_tuple(stuff)
if foo is None:
      ......

and wondering why the program doesn't work properly.

If you had to do that, you might try:

foo, bar, _ = gen_tuple(stuff)

or in a more complex case.

foo, _, _, bar, _, baz, _ = gen_tuple(stuff)

as '_' is already special cased (last result in interactive mode), and 
is already used for "don't care" sematics in Prolog.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to