Skip to content

Clarify what unparameterized Tuple means #284

Closed

Description

@gvanrossum

Currently when you annotate something as Tuple, mypy interprets this as a 0-length tuple. I don't like this. PEP 484 is silent on the matter, but in analogy of List I'd like it to mean Tuple[Any, ...], which is also equivalent to tuple (lowercase 't').

Activity

  1. ilevkivskyi commented on Sep 26, 2016

    @ilevkivskyi
    Member

    Absolutely +1 on this. I will be glad to make a PR to python/peps on this.

  2. gvanrossum commented on Sep 26, 2016

    @gvanrossum
    MemberAuthor

    OK, please go ahead with the PEP 484 PR. (I also couldn't find where it says that List means List[Any] -- it says something about subclassing without specifying parameters, but that's not relevant -- I'm just talking about using List in type annotations. That meaning is uncontroversial, but if it isn't said somewhere it still ought to be mentioned.

  3. added a commit that references this issue on Sep 27, 2016
    5f30d8f
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