what exactly is "None" ?

Erik Max Francis max at alcyone.com
Tue Mar 4 21:32:25 EST 2003


phil hunt wrote:

> None is equal to None. All values other than None are not equal t
> None.

Unfortunately, that's not quite true, since a custom class can override
__cmp__ or __eq__ to make it equal (==) to None.  The proper way to
check for None-ness is by identity (is).

It's true for all the builtin types, though.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ And your daddy died for you / And I'll do the same
\__/ India Arie
    Bosskey.net: Counter-Strike / http://www.bosskey.net/cs/
 A personal guide to Counter-Strike.




More information about the Python-list mailing list