.. _consider-using-from-import:

consider-using-from-import / R0402
==================================

**Message emitted:**

Use 'from %s import %s' instead

**Description:**

*Emitted when a submodule of a package is imported and aliased with the same name, e.g., instead of ``import concurrent.futures as futures`` use ``from concurrent import futures``.*

**Problematic code:**

.. literalinclude:: /data/messages/c/consider-using-from-import/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/c/consider-using-from-import/good.py
   :language: python



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