Why is this an issue?

__all__ is used to define the list of module’s names that should be imported when from package import * is used. For that reason, it may only contain strings.

Noncompliant code example

class MyClass:
    pass

__all__ = [
    MyClass  # Noncompliant
]

Compliant solution

class MyClass:
    pass

__all__ = [
    "MyClass"
]

Resources