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

Don't remove re-exported imports #258

Open
thejcannon opened this issue May 19, 2023 · 2 comments
Open

Don't remove re-exported imports #258

thejcannon opened this issue May 19, 2023 · 2 comments

Comments

@thejcannon
Copy link

thejcannon commented May 19, 2023

mypy has the concept of "re-export"ing a module by importing it and giving it the same name in the as dotted name:
https://mypy.readthedocs.io/en/stable/config_file.html#confval-implicit_reexport

from whatever import thing as thing

thing may not be used, but it needs to stay, since it is being exported. (This is primarily to allow for moving a definition but maintaining backwards compatibility).

It'd be great if autoflake doesn't remove these.

@fsouza
Copy link
Collaborator

fsouza commented May 20, 2023

I imagine we'd need to get this into pyflakes so pyflakes doesn't report the issue for us.

There's some history on why this isn't supported by pyflakes though: PyCQA/pyflakes#474

@thejcannon
Copy link
Author

Oh yeah whoops. I should've known better 🤦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants