[issue2503] Replace "== None/True/False" with "is"
Amaury Forgeot d'Arc
report at bugs.python.org
Fri Mar 28 14:24:33 CET 2008
Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
Yes, PEP8 says::
Comparisons to singletons like None should always be done with
'is' or 'is not', never the equality operators.
Reading the patch:
- a change modifies "x == False" into "not x", another moves some lines.
I checked that they are OK (x is already the result of a comparison).
- some occurrences of "x != None" are not replaced. Why? (ex. in
test_ast.py)
__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2503>
__________________________________
More information about the Python-bugs-list
mailing list