mypy
mypy copied to clipboard
(🐞) False `except` contains `Any` when inside a function that references a variable that is defined after the function and has an inferred type
def f():
a
try:
pass
except Exception as ex: # error: Expression has type "Any" [misc]
pass
a = 1 + 1
Related to #8900