Skip to content

'in' operator rejected with union right operand #4954

@JukkaL

Description

@JukkaL

Mypy generates a false positive for this fragment:

from typing import Iterable, Container, Union

i: Iterable[str]
c: Container[str]
u: Union[Iterable[str], Container[str]]

'x' in i
'x' in c
'x' in u  # Unsupported right operand type for in ("Union[Iterable[str], Container[str]]")

This should be easy to fix.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions