.. _singleton-comparison:

singleton-comparison / C0121
============================

**Message emitted:**

Comparison %s should be %s

**Description:**

*Used when an expression is compared to singleton values like True, False or None.*

**Problematic code:**

.. literalinclude:: /data/messages/s/singleton-comparison/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/s/singleton-comparison/good.py
   :language: python


**Related links:**

- `PEP 285 – Adding a bool type <https://peps.python.org/pep-0285/>`_

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