.. _import-private-name:

import-private-name / C2701
===========================

**Message emitted:**

Imported private %s (%s)

**Description:**

*Used when a private module or object prefixed with _ is imported. PEP8 guidance on Naming Conventions states that public attributes with leading underscores should be considered private.*


**Correct code:**

.. literalinclude:: /data/messages/i/import-private-name/good.py
   :language: python

**Additional details:**

You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !



.. note::
  This message is emitted by the optional :ref:`'import-private-name'<pylint.extensions.private_import>`
   checker which requires the ``pylint.extensions.private_import`` plugin to be loaded.

Created by the `import-private-name <https://github.com/PyCQA/pylint/blob/main/pylint/extensions/private_import.py>`__ checker.