Hi, this started happening after I upgraded to 1.20 today.
xxx: Any=object()
deffunc() ->None:
if1isnotxxx:
returnreveal_type(xxx) # Revealed type is "Literal[1]"
This lead to the code that utilises sentinel objects breaking:
_missing: Any=object()
deffunc(
alias: str|None=_missing,
id_: UUID|None=_missing,
) ->bool:
returnaliasisnot_missingorid_isnot_missing# Non-overlapping identity check (left operand type: "UUID | None", right operand type: "str | None") [comparison-overlap]
Your Environment
- Mypy version used:
mypy 1.20.0 (compiled: yes) - Mypy command-line flags: none
- Mypy configuration options from
mypy.ini (and other config files): strict - Python version used: 3.13.5
Hi, this started happening after I upgraded to 1.20 today.
This lead to the code that utilises sentinel objects breaking:
Your Environment
mypy 1.20.0 (compiled: yes)mypy.ini(and other config files): strict