Skip to content

Populate __all__ to avoid unused name errors #16

@jayvdb

Description

@jayvdb

When a module imports many names from sub-modules, and does not include any code except for those imports, the module is obviously intended to hold names.

Those names should be put into __all__.

e.g. the following causes pyflakes errors, as Foo and Bar are unused:

from a.b import Foo
from a.c import Bar

To avoid this,

from a.b import Bar
from a.c import Foo

__all__ = ('Bar', 'Foo')

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions