Since a lot of people trip over this, let me repeat an important and useful
passage from PEP8,
the Python styleguide:
- Comparisons to singletons like None should always be done with
'is' or 'is not', never the equality operators.
Also, beware of writing "if x" when you really mean "if x is not None"
-- e.g. when testing whether a variable or argument that defaults to
...
Posted by
Philipp von Weitershausen @ 11/09/2007 03:29 PM.
-
Categories:
Python
-
0 comments