Skip to content

Instantly share code, notes, and snippets.

@dogweather
Last active October 4, 2022 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dogweather/c212263c2d86f33339c70bd51c6dd878 to your computer and use it in GitHub Desktop.
Save dogweather/c212263c2d86f33339c70bd51c6dd878 to your computer and use it in GitHub Desktop.
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