.. _use-implicit-booleaness-not-comparison: use-implicit-booleaness-not-comparison / C1803 ============================================== **Message emitted:** ``"%s" can be simplified to "%s", if it is strictly a sequence, as an empty %s is falsey`` **Description:** *Empty sequences are considered false in a boolean context. Following this check blindly in weakly typed code base can create hard to debug issues. If the value can be something else that is falsey but not a sequence (for example ``None``, an empty string, or ``0``) the code will not be equivalent.* **Problematic code:** .. literalinclude:: /data/messages/u/use-implicit-booleaness-not-comparison/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/u/use-implicit-booleaness-not-comparison/good.py :language: python Created by the `refactoring `__ checker.