pylint-errors

R1719 (simplifiable-if-expression)

:x: Problematic code:

foo = [('x', 1), ('y', 2), ('z', 3)]
bar = None

if foo:
    bar = True
else:
    bar = False

:heavy_check_mark: Correct code:

foo = [('x', 1), ('y', 2), ('z', 3)]
bar = bool(foo)

Rationale:

Used when an if expression can be replaced with bool(test).