FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow type aliases such X = List[T] if T is a type variable · Issue #606 · python/mypy · GitHub

/ mypy Public

Allow type aliases such X = List[T] if T is a type variable #606

Description

This code should be okay:

from typing import TypeVar, List
T = TypeVar('T')
X = List[T]
def f(x: X) -> None: ...

It should be equivalent to this:

from typing import TypeVar, List
T = TypeVar('T')
def f(x: List[T]) -> None: ...

This was suggested by Guido, "based on the general equivalence in Python of

X = <stuff>
f(X)

to

f(<stuff>)

".

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL