<var> is None vs. <var> == None

Gerald Britton gerald.britton at gmail.com
Fri Jan 23 14:58:34 EST 2009


Hi -- Some time ago I ran across a comment recommending using <var> is
None instead of <var> == None (also <var> is not None, etc.)  My own
testing indicates that the former beats the latter by about 30% on
average.  Not a log for a single instruction but it can add up in
large projects.

I'm looking for a (semi)-official statement on this, but couldn't find
one with normal googling.  Can someone please send a link?



More information about the Python-list mailing list