deadcode
deadcode copied to clipboard
Type-checking only imports shouldn't be considered as a deadcode
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