hadialqattan / pycln

A formatter for finding and removing unused import statements.

Home Page:https://hadialqattan.github.io/pycln

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] string type annotation containing a constant like type

hadialqattan opened this issue · comments

example.py

from ast import Import
from typing import List

def foo(bar: "List['Import']"):
    pass

Current behavior, ast.Import is considered as unused:

from typing import List

def foo(bar: "List['Import']"):
    pass

Expected behavior, nothing should be changed:

from ast import Import
from typing import List

def foo(bar: "List['Import']"):
    pass