Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use __all__ to declare modules public APIs (would also fix F401 warnings) #47

Open
Horgix opened this issue May 3, 2021 · 0 comments
Open
Labels
refactoring Stuff to refactor (without features impact) tooling/lint #52B06B

Comments

@Horgix
Copy link
Collaborator

Horgix commented May 3, 2021

Currently, modules import a lot of their submodules in their __init__.py so they can be easily imported by users with from myAwesomeModule import *.

However, since these import are not actually used in these __init__.py, they trigger the F401 "Module imported but unused" warning.

Moreover, it's recommended by the PEP8 that modules declare their public API through __all__ (See PEP8 → Public and Internal interfaces)

@Horgix Horgix added tooling/lint #52B06B refactoring Stuff to refactor (without features impact) labels May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Stuff to refactor (without features impact) tooling/lint #52B06B
Projects
None yet
Development

No branches or pull requests

1 participant