pnijhara / gitsome

Built-in function len used as condition PYL-C1802
Performance
Major
4 years ago4 years old
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty
892    with p.group(len(name) + 1, name + "(", ")"):
893        if cycle:
894            p.text("...")
895        elif len(obj):896            p.pretty(dict(obj))
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty
874    with p.group(len(name) + 1, name + "(", ")"):
875        if cycle:
876            p.text("...")
877        elif len(obj):878            p.pretty(list(obj.items()))
879
880
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty
1552        with p.group(0, name + "(", ")"):
1553            if cycle:
1554                p.text("...")
1555            elif len(self):1556                p.break_()
1557                p.pretty(dict(self))
1558
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty
 354        with p.group(0, name + "(", ")"):
 355            if cycle:
 356                p.text("...")
 357            elif len(self): 358                p.break_()
 359                p.pretty(dict(self))
 360
Do not use len(SEQUENCE) without comparison to determine if a sequence is empty
162        with p.group(0, name + "(", ")"):
163            if cycle:
164                p.text("...")
165            elif len(self):166                p.break_()
167                p.pretty(dict(self))
168