Skip to content

Do not allow TypeVarTuple after TypeVar with a default #3265

@sobolevn

Description

@sobolevn

There's a pattern that is allowed from typing perspective:

class X[T=int, *Ts=*tuple[int, ...]]: ...

https://mypy-play.net/?mypy=latest&python=3.13&gist=cbd582efc127e91a38a022d99ea7269f

But, it is a really bad pattern, because you cannot specify *Ts without specifing T

So, we need to find type_params definitions where TypeVar with default is followed by TypeVarTuple with default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions