Detect type hints: PEP484
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
New
|
Undecided
|
Unassigned |
Bug Description
Hi,
thanks for this really great tool!
One issues I stumbled upon was that type hints seem to be ignored / not detected.
For example, we have an import at the top of a file:
from typing import List
And then later in an __init__ function something like this:
self.scripts = [] # type: List[script.Script]
Now running pyflakes (through flake8) gives me this error:
foo.py:4:1: F401 'List' imported but unused
PEP484 defines this kind of type comments.
Is there an option to enable type hint detection?
Or can we have that as feature request? I guess I'm fine with type comments only for the time being, but of course a fully PEP484 compliant solution would be greatly appreciated :)
Thanks!
Is it really necessary to have the unused imports for the typing comments to work?