.. _literal-comparison: literal-comparison / R0123 ========================== **Message emitted:** ``In '%s', use '%s' when comparing constant literals not '%s' ('%s')`` **Description:** *Used when comparing an object to a literal, which is usually what you do not want to do, since you can compare to a different literal than what was expected altogether.* **Problematic code:** .. literalinclude:: /data/messages/l/literal-comparison/bad.py :language: python **Correct code:** .. literalinclude:: /data/messages/l/literal-comparison/good.py :language: python **Related links:** - `Comparison operations in Python `_ Created by the `basic `__ checker.