PyCQA / autoflake

Removes unused imports and unused variables as reported by pyflakes

Home Page:https://pypi.org/project/autoflake/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't remove re-exported imports

thejcannon opened this issue · comments

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.

commented

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

Oh yeah whoops. I should've known better 🤦