generics_typevartuple_unpack error

TypeVarTuple unpack minimum type argument violation

When a function parameter has a type annotation containing a TypeVarTuple unpack pattern like ArrayBatch, *tuple[Any, ..., Channels], the type has fixed prefix and suffix type arguments around a variadic middle. Any value passed to that parameter must have at least prefix_count + suffix_count type arguments.

Ts = TypeVarTuple("Ts")

class Array(Generic[*Ts]): ...

def process(x: Array[Batch, *tuple[Any, ...], Channels]) -> None: ...

def func(z: Array[Batch]):
    process(z)  # E -- Array[Batch] has 1 type arg, need at least 2

How to handle it

Every rule is on by default — strict is the default, not a cage. You can dial generics_typevartuple_unpack down per-file or per-path from your editor or pyproject.toml, or fix the code so it type-checks. See the Type System rules and the complete diagnostic reference.

Canonical URL: https://www.basilisk-python.dev/errors/generics_typevartuple_unpack