Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Minimal Python Exhaustiveness Check Demo
def get_float(num: str | float):
match (num):
case str(num):
return float(num)
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