Skip to content

Tuple[...] should be compatible with Iterable[...] and Sequence[...] #296

@JukkaL

Description

@JukkaL

Currently, Tuple[int, int] is not compatible with Iterable[int] and Sequence[int], but it should obviously be. Also, update type join to support this (join of Tuple[int, int] and Tuple[int] should be Sequence[int]).

For example, this program is rejected:

from typing import Iterable
def f(x: Iterable[int]) -> None: pass
f([1,2])  # OK
f((1,2))  # Argument 1 to "f" has incompatible type "Tuple[int, int]"

See also #184 (it's very closely related).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions