Skip to content

STYLE: Update python script to use "is None" instead of "== None"

Sam Horvath requested to merge github/fork/jcfr/python-style-use-is-None into master

Created by: jcfr

Rational copied from https://www.python.org/dev/peps/pep-0290/#testing-for-none

// ----------------- Since there is only one None object, equality can be tested with identity. Identity tests are slightly faster than equality tests. Also, some object types may overload comparison, so equality testing may be much slower.

Pattern:

if v == None --> if v is None: if v != None --> if v is not None: // -----------------

Merge request reports