Skip to content

Instantly share code, notes, and snippets.

@dogweather
Last active October 4, 2022 01:39
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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