mypy and lambda quit()

Viewed 152

I have this problem with mypy under python 3.88 and w7, am I the only one?

x = lambda: quit()
print(1) # ok

if __name__ == "__main__":
    print(2)  # Mypy: Statement is unreachable

You should use the mypy option --warn-unreachable to see the error. To be more clear: print(2) is evaluated by Python but for mypy it is unreachable. Someone can explain to me why? Or it is a mypy bug?

0 Answers
Related