Re: Assigning to None
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Assigning to None

From: Mike Meyer <mwm@mired.org>
Date: Fri Jul 01 2005 - 19:45:12 CEST

Peter Hansen <peter@engcorp.com> 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

-- 
Mike Meyer <mwm@mired.org>			http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
Received on Thu Sep 29 16:41:48 2005