.. _bad-chained-comparison: bad-chained-comparison / W3601 ============================== **Message emitted:** ``Suspicious %s-part chained comparison using semantically incompatible operators (%s)`` **Description:** *Used when there is a chained comparison where one expression is part of two comparisons that belong to different semantic groups ("<" does not mean the same thing as "is", chaining them in "0 < x is None" is probably a mistake).* **Problematic code:** ``parrot.py``: .. literalinclude:: /data/messages/b/bad-chained-comparison/bad/parrot.py :language: python ``xor.py``: .. literalinclude:: /data/messages/b/bad-chained-comparison/bad/xor.py :language: python **Correct code:** ``parrot.py``: .. literalinclude:: /data/messages/b/bad-chained-comparison/good/parrot.py :language: python ``xor.py``: .. literalinclude:: /data/messages/b/bad-chained-comparison/good/xor.py :language: python **Related links:** - `Comparison Chaining `_ Created by the `bad-chained-comparison `__ checker.