Back to Intellij Community

PySimplifyBooleanCheckInspection

python/python-psi-impl/resources/inspectionDescriptions/PySimplifyBooleanCheckInspection.html

2025.3-rc-2271 B
Original Source

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)