What's wrong with `is not None`?

François Pinard pinard at iro.umontreal.ca
Wed Feb 9 09:25:34 EST 2005


[Stefan Behnel]

> Frans Englich schrieb:
> >What is the equivalent expression which is more secure; `!= None`?

> If I want to check for None, I always do it with "is". It's a constant
> after all...

So do I.  There is only one None object, for which an `is' test is
especially appropriate.

-- 
François Pinard   http://pinard.progiciels-bpi.ca



More information about the Python-list mailing list