[FRPythoneers] Python documentation and default expression

Jeffery D. Collins jcollins at boulder.net
Fri Mar 15 18:16:36 MST 2002


<snip>

> I've almost always used "if foo != None:". Is there a reason not to
> write it as such?
>
> -Rob

No.  The "is" compares object identities and the "==" ("!=") compares object
values.
Since None is a singleton and comparisons are always done wrt to its
identity,
the results will be identical.

--
Jeffery Collins (http://www.boulder.net/~jcollins)





More information about the FRPythoneers mailing list