basedmypy
basedmypy copied to clipboard
narrow types under same constant condition
a: Final[str]
if a == "a":
def f(): ...
if a == "a":
f()
this shouldn't be an error
also possibly-undefined:
def func(x: bool):
if x:
msg = 'hello world'
if x:
print(msg)