Skip to content

Union of same Tuple with slice or index lose type and size #1579

Closed

Description

@tharvik
from typing import List, Tuple, Union

def f() -> Union[Tuple[str], Tuple[str]]: return 'a',

v = f()
''.join(v[:])

gives

asd.py:6: error: Argument 1 to "join" of "str" has incompatible type Tuple[_T_co, ...]; expected Iterable[str]
asd.py:7: error: List item 0 has incompatible type "_T_co"

Seems somehow that the tuple "lose" his type (and his size).

How course, it is a simplified example.

Might be related to #1578.

Activity

  1. changed the title [-]Union of same Tuple with slice lose type and size[/-] [+]Union of same Tuple with slice or index lose type and size[/+] on May 25, 2016
  2. tharvik commented on Jul 7, 2016

    @tharvik
    ContributorAuthor

    This has been fixed by #1596.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions