pylint-errors

C1801 (len-as-condition)

:x: Problematic code:

array = []
if len(array):
    pass

:heavy_check_mark: Correct code:

array = []
if len(array) > 0:
    pass

Rationale:

Used when Pylint detects that len(sequence) is being used without explicit comparison inside a condition to determine if a sequence is empty. Instead of coercing the length to a boolean, either rely on the fact that empty sequences are false or compare the length against a scalar.