Skip to content

Fix type argument count check for Instances #15411

@ilevkivskyi

Description

@ilevkivskyi

Currently for a class defined as

T = TypeVar("T", bound=int)
S = TypeVar("S", bound=str)
Ts = TypeVarTuple("Ts")

class G(Generic[T, Unpack[Ts], S]): ...

we allow a least 2 type arguments, but in fact 1 type argument may be fine as well, for example if it is an unpack of fixed (or maybe even variable) length tuple, or an unpack of TypeVarTuple (bound in current scope).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions