basedmypy
basedmypy copied to clipboard
Ensure defs from `TYPE_CHECKING` also exist in the else branch
if TYPE_CHECKING:
a = 1 # no corresponding real definition
print(a)
Of course this doesn't facilitate all usages:
if TYPE_CHECKING:
from _typedshed import SupportsAmongUs
a: SupportsAmongUs # only used as type, so it's ok
But really, that usage should be handled better, like with a type import.