Description
Bug Report
X and sys.platform == "win32"
does not mark the block as unreachable, but sys.platform == "win32" and X
does. This probably has been reported before but I'm not sure how to phrase this let alone search issues.
To Reproduce
import sys
X = True
if X and sys.platform == "win32":
reveal_type(False) # N: Revealed type is "Literal[False]?"
Expected Behavior
I expect the branch to be unreachable, so the reveal_type
should not show anything
Your Environment
Reproduced in mypy play.
- Mypy version used: v1.15
- Mypy command-line flags: N/A
- Mypy configuration options from
mypy.ini
(and other config files): N/A - Python version used: 3.12