.. _invalid-all-object:

invalid-all-object / E0604
==========================

**Message emitted:**

Invalid object %r in __all__, must contain only strings

**Description:**

*Used when an invalid (non-string) object occurs in __all__.*

**Problematic code:**

.. literalinclude:: /data/messages/i/invalid-all-object/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/i/invalid-all-object/good.py
   :language: python

**Additional details:**

From `The Python Language Reference – The import statement <https://docs.python.org/3/reference/simple_stmts.html#the-import-statement>`_:
    "The `public names` defined by a module are determined by checking the module's namespace for a variable named ``__all__``; if defined, it must be a sequence of strings which are names defined or imported by that module."

**Related links:**

- `PEP 8 – Style Guide for Python Code <https://peps.python.org/pep-0008/#module-level-dunder-names>`_

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