.. _misplaced-comparison-constant:

misplaced-comparison-constant / C2201
=====================================

**Message emitted:**

Comparison should be %s

**Description:**

*Used when the constant is placed on the left side of a comparison. It is usually clearer in intent to place it in the right hand side of the comparison.*

**Problematic code:**

.. literalinclude:: /data/messages/m/misplaced-comparison-constant/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/m/misplaced-comparison-constant/good.py
   :language: python




.. note::
  This message is emitted by the optional :ref:`'comparison-placement'<pylint.extensions.comparison_placement>`
   checker which requires the ``pylint.extensions.comparison_placement`` plugin to be loaded.

Created by the `comparison-placement <https://github.com/PyCQA/pylint/blob/main/pylint/extensions/comparison_placement.py>`__ checker.