Redundant boolean variable check
Reports equality comparison with a boolean literal.
Example:
def func(s):
if s.isdigit() == True:
return int(s)
With the quick-fix applied, the code fragment will be simplified to:
def func(s):
if s.isdigit():
return int(s)
Inspection options
Option | Type | Default |
---|---|---|
Ignore comparison to zero | Checkbox | true |
Inspection Details | |
---|---|
Available in: | DataSpell 2023.3, PyCharm 2023.3 |
Plugin: | Python Community Edition, 233.SNAPSHOT |
Last modified: 13 July 2023