Ask a static type checker to confirm that a line of code is unreachable.
typing.assert_never(arg, /)
def int_or_str(arg: int | str) -> None:
match arg:
case int():
print("It's an int")
case str():
print("It's a str")
case _ as unreachable:
assert_never(unreachable)