Created
December 21, 2024 00:48
-
-
Save mypy-play/c42e62c91d23507603844e6e4abd8382 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Union, Never | |
def check(x: int) -> Union[Never, str]: | |
try: | |
assert x == 2, "Expected 2" | |
return "Sat" | |
except AssertionError as msg: | |
print(msg) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Mypy returns with
Does Never work other than specified?