[issue2503] Replace "== None/True/False" with "is"

Wummel report at bugs.python.org
Fri Mar 28 14:46:55 CET 2008


Wummel <calvin at users.sourceforge.net> added the comment:

Amaury, I never saw an object comparing equal to None.
I think the most likely case is a buggy x.__eq__() implementation. Then
the "if x == None" statement gets triggered, and somebody has a hard
time with bug hunting.

Just a note: I used an adapted source checker for this patch, which
initially came from the Sphinx documentation project, found under
tools/check_sources.py. So the credits for this go to Georg Brandl.

That is also why '!=' did not get replaced (the source checker only
searched for '=='. I will post an updated patch.

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2503>
__________________________________


More information about the Python-bugs-list mailing list