Skip to content
Snippets Groups Projects

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

Closed 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

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Loading
  • Loading
  • Loading
  • Loading
Please register or sign in to reply
Loading