.. _simplifiable-if-expression:
simplifiable-if-expression / R1719
==================================
**Message emitted:**
``The if expression can be replaced with %s``
**Description:**
*Used when an if expression can be replaced with 'bool(test)' or simply 'test' if the boolean cast is implicit.*
**Problematic code:**
.. literalinclude:: /data/messages/s/simplifiable-if-expression/bad.py
:language: python
**Correct code:**
.. literalinclude:: /data/messages/s/simplifiable-if-expression/good.py
:language: python
**Related links:**
- `Simplifying an 'if' statement with bool() `_
Created by the `refactoring `__ checker.