Import used by type annotation inside __new__ is considered unused
Bug #1670468 reported by
Thomas Hauk
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Pyflakes |
New
|
Undecided
|
Unassigned |
Bug Description
An import used by a type annotation inside __new__() in a metaclass is considered unused by flake8/
e.g. given:
from django.db.models import Model
class SomeMetaclass(
def __new__(mcs, name, bases, attrs):
return super()
Running flake8 results in the error:
example.py:1:1: F401 'django.
Versions:
Python 3.6
flake8 3.3.0
mccabe 0.6.1
pycodestyle 2.3.1
pyflakes 1.5.0
To post a comment you must log in.
I believe this was fixed here https:/ /github. com/PyCQA/ pyflakes/ pull/88