forked from python/mypy
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert_unreachable
function
#147
Labels
Comments
Would lead up be allowed? eg: a: float = 1
if not isinstance(a, float):
message = "LOOL!"
logger.warning(DuckTypingError(message))
assert_unreachable(message) |
i don't think so |
when if False:
print(1) #error: unreachable
assert_unreachable() # no error
else:
assert_unreachable() # error when if False:
print(1) # no error
assert_unreachable() # no error
else:
assert_unreachable() # error |
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
KotlinIsland/basedtyping#28
would need to invert the
unreachable
error code when it sees anassert_unreachable
call, such that it's raised if the code is reachable. perhaps a seperate error code?when
warn-unreachable
is enabledWhen
warn-unreachable
is disabledThe text was updated successfully, but these errors were encountered: