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

Autoflake is removing imports specified in typehint comment

ranjith19 opened this issue · comments

For sqlalchemy code typehints are present in my codebase as comments (Old syntax)

from .class2 import Class2

class Class3:
    f1 = Column(String) # type: Class2

When autoflake runs on this, it is making the import disappear

This feature was removed in pyflakes 3 and autoflake 2, as those tools are now Python 3 only. If you need to use type hint comments, you should stick to autoflake<2.0.0.