-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed as not planned
Labels
bugmypy got something wrongmypy got something wrongtopic-match-statementPython 3.10's match statementPython 3.10's match statement
Description
Bug Report
Looks like case guards make match non-exhaustive even when having wildcard case
To Reproduce
def do_thing(s: str) -> str:
match s:
case str(x) if x == "something":
return x
case _:
return ""Expected Behavior
No error
Actual Behavior
error: Missing return statement [return]
Your Environment
- Mypy version used: 1.5.1
- Mypy command-line flags:
--install-types --non-interactive - Mypy configuration options from
mypy.ini(and other config files):[tool.mypy] python_version = "3.11" strict = true warn_unused_configs = true disallow_untyped_decorators = false - Python version used: 3.11.4
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-match-statementPython 3.10's match statementPython 3.10's match statement