Eg with the following:
fromtypingimport*classFoo:
def__bool__(self) ->Literal[True]:
returnTruedefsome_foo() ->Foo:
...
defthrow_error():
raiseExceptionif__name__=='__main__':
print(some_foo() orthrow_error())
# ^^^^^^^^^^^^^ impossible condition, unreachable
mypy should be able to detect that the call to throw_error is unreachable
Eg with the following:
mypy should be able to detect that the call to throw_error is unreachable