-
Notifications
You must be signed in to change notification settings - Fork 179
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
F401 (imported but not used) in __init__.py #471
Comments
If you list the things you export in |
When you have a large amount of objects, it's convenient to define __all__ = tuple(k for k in locals() if not k.startswith("_")) |
sure, I was just giving the suggestion from the duplicate issue #162 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Virtually every medium to large library package I've encountered so far is structured as follows:
impl.py
defines objects__init__.py
imports them, so that the library users don't need to know aboutimpl.py
.At the moment, the
__init__.py
modules of packages that use flake8 are littered with either# noqa: F401
on every single line or# flake8: noqa
at the top of the module which blanket disables everything.This change request is to add a special case in pyflakes that disables F401 (only) when the file name is
__init__.py
.An alternative approach would be to add to flake8 the ability to suppress specific errors at module level, e.g.
# flake8: noqa: F401
.The text was updated successfully, but these errors were encountered: