Exhaustiveness of type tuple[bool, bool]
Author: JulienPalardCreated Sep 11, 2026Updated Sep 13, 2026
Labelsbugtopic-match-statementtopic-reachability
Bug Report
It looks like the exhaustiveness of tuples of bools is not checked in match statements.
To Reproduce
def measure(a: bool, b: bool) -> float:
match a, b:
case True, True:
return 1
case True, False:
return 0.9
case False, True:
return 0.5
case False, False:
return 0Expected Behavior
Should pass, looks exhaustive to me (or I should go take a nap).
Actual Behavior
$ mypy --enable-error-code exhaustive-match repro.py
repro.py:1: error: Missing return statement [return]
repro.py:2: error: Match statement has unhandled case for values of type "tuple[bool, bool]" [exhaustive-match]
repro.py:2: note: If match statement is intended to be non-exhaustive, add `case _: pass`
Found 2 errors in 1 file (checked 1 source file)Your Environment
- Mypy version used: mypy 2.3.1 (compiled: yes)
- Mypy command-line flags:
--enable-error-code exhaustive-match - Mypy configuration options from
mypy.ini(and other config files): ø - Python version used: 3.14.7
Source: python/mypy