Minimal Python Exhaustiveness Check Demo
This file contains 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
def get_float(num: str | float): | |
match (num): | |
case str(num): | |
return float(num) |
This file contains 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
error: Cases within match statement do not exhaustively handle all values | |
Unhandled type: "float" | |
If exhaustive handling is not intended, add "case _: pass" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment