Skip to content

How to type hints for a genetic input tuple, with list[T] map to T #2063

@baitian752

Description

@baitian752
def func[T, *Ts1, *Ts2](values: tuple[*Ts1, list[T], *Ts2]) -> tuple[*Ts1, T, *Ts2]: ...

This is not valid as the document say:

However, note that at most one type variable tuple may appear in a single list of type arguments or type parameters

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