Assigning to None

Mike Meyer mwm at
Fri Jul 1 19:45:12 CEST 2005

Peter Hansen <peter at> 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've never seen that usage anywhere else.

Mike Meyer <mwm at>
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.

More information about the Python-list mailing list