.. _cyclic-import: cyclic-import / R0401 ===================== **Message emitted:** ``Cyclic import (%s)`` **Description:** *Used when a cyclic import between two or more modules is detected.* **Problematic code:** ``__init__.py``: .. literalinclude:: /data/messages/c/cyclic-import/bad/__init__.py :language: python ``bad.py``: .. literalinclude:: /data/messages/c/cyclic-import/bad/bad.py :language: python ``bad2.py``: .. literalinclude:: /data/messages/c/cyclic-import/bad/bad2.py :language: python **Correct code:** .. literalinclude:: /data/messages/c/cyclic-import/good.py :language: python **Additional details:** The good code is just an example. There are various strategies to resolving cyclic imports and the best choice relies heavily on the context of the code and the affected modules. Created by the `imports `__ checker.