Skip to content

Non-overlapping identity check when left operand is not optional and right operand is None #11888

Description

@sami-evangelista

mypy does not complain on line 4 of this code:

i: int=1s: str='hi'iiss# error: Non-overlapping identity check (left operand type: "int", right operand type: "str")ifiisNone: # ok
...

would it be possible to raise a Non-overlapping identity check error in that case, as in the previous line?

mypy version:

$ mypy --version
mypy 0.930

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions