.. _use-implicit-booleaness-not-comparison-to-zero: use-implicit-booleaness-not-comparison-to-zero / C1805 ====================================================== **Message emitted:** ``"%s" can be simplified to "%s", if it is strictly an int, as 0 is falsey`` **Description:** *0 is 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 an int (for example ``None``, an empty string, or an empty sequence) the code will not be equivalent.* .. caution:: This message is disabled by default. To enable it, add ``use-implicit-booleaness-not-comparison-to-zero`` to the ``enable`` option. **Problematic code:** .. literalinclude:: /data/messages/u/use-implicit-booleaness-not-comparison-to-zero/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/u/use-implicit-booleaness-not-comparison-to-zero/good.py :language: python **Configuration file:** .. literalinclude:: /data/messages/u/use-implicit-booleaness-not-comparison-to-zero/pylintrc :language: ini Created by the `refactoring `__ checker.