Skip to content

Files

Latest commit

 

History

History
31 lines (18 loc) · 551 Bytes

singleton-comparison.md

File metadata and controls

31 lines (18 loc) · 551 Bytes

Pattern: Missing is or is not for singleton comparison

Issue: -

Description

This rule enforces PEP 8 recommendation to use is or is not over equality operators for singleton comparison.

Example of incorrect code:

number = None

if number == None:
    print "number is None"

Example of correct code:

number = None

if number is None:
    print "number is None"

Further Reading