Skip to content

Get generic of typevar #1999

Open
Open
@STofone

Description

@STofone

support something like this

class A[T]:
    def __init__(self, t: T):
        self.t = t


class B:
    def x[TA: A](self, a: TA) -> TA.T:
        return a.t

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: featureDiscussions about new features for Python's type annotations

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions