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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy