.. _chained-comparison:

chained-comparison / R1716
==========================

**Message emitted:**

Simplify chained comparison between the operands

**Description:**

*This message is emitted when pylint encounters boolean operation like "a < b and b < c", suggesting instead to refactor it to "a < b < c"*

**Problematic code:**

.. literalinclude:: /data/messages/c/chained-comparison/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/c/chained-comparison/good.py
   :language: python



Created by the `refactoring <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/refactoring/refactoring_checker.py>`__ checker.