deadcode icon indicating copy to clipboard operation
deadcode copied to clipboard

Type-checking only imports shouldn't be considered as a deadcode

Open serozhenka opened this issue 5 months ago • 0 comments

test.py

from  typing import TYPE_CHECKING

if TYPE_CHECKING:
    from abc import ABC


a: "ABC | None" = None
print(a)

python test.py

test.py:4:20: DC07 Import `ABC` is never used

Expected: no errrors

serozhenka avatar Oct 28 '25 19:10 serozhenka