basedmypy
basedmypy copied to clipboard
understand that imports within `TYPE_CHECKING` shouldn't be used in runtime positions
from typing import TYPE_CHECKING
if TYPE_CHECKING:
import sys
sys # expect error: sys is imported as type only
- related #166 It's kinda a half measure of fixing it
BTW, ruff does handle this
I wonder if there is any use case where you want to type checker to think something is imported because at runtime it actually is imported.
It should be a config options then.