.. _use-implicit-booleaness-not-len: use-implicit-booleaness-not-len / C1802 ======================================= **Message emitted:** ``Do not use `len(SEQUENCE)` without comparison to determine if a sequence is empty`` **Description:** *Empty sequences are considered false in a boolean context. You can either remove the call to 'len' (``if not x``) or compare the length against a scalar (``if len(x) > 1``).* **Problematic code:** .. literalinclude:: /data/messages/u/use-implicit-booleaness-not-len/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/u/use-implicit-booleaness-not-len/good.py :language: python Created by the `refactoring `__ checker.