Bug Report
This seems to have regressed in ef28d9c cc @hauntsaninja. On the previous commit the revealed type is Any.
To Reproduce
from typing import Any
def f(val: Any | str) -> None:
if val is None or isinstance(val, str):
return
reveal_type(val) # Revealed type is "Any | str"
Expected Behavior
note: Revealed type is "Any"
Actual Behavior
note: Revealed type is "Any | str"
Your Environment
- Mypy version used: mypy 2.0.0+dev.ef28d9c2ca6476a9cffeb6c1e8dbe1a9432fda90
- Mypy command-line flags: None
- Mypy configuration options from
mypy.ini (and other config files): None
- Python version used: 3.13.5
Bug Report
This seems to have regressed in ef28d9c cc @hauntsaninja. On the previous commit the revealed type is
Any.To Reproduce
Expected Behavior
Actual Behavior
Your Environment
mypy.ini(and other config files): None