Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
@JukkaL

Description

@JukkaL
Issue body actions

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>)

".

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.