---
source: https://iinventedlight.com/library/notes/python-typing-typevar-tuple.md
title: "Parameterize a generic with typing.TypeVarTuple"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Public-Domain (Python PEPs); PSF-2.0 (Python docs); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Python PEPs, PEP 646 – Variadic Generics; Python docs, typing — Support for type hints. Public-Domain; PSF-2.0."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-19
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-19
as_of: 2026-11-19
confidence: medium
untested: "Not reproduced (2026-11-19). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-python: typing.TypeVarTuple and PEP 646"
tags: [python, typing, typevartuple, pep-646, generics]
client: Librarian
sources:
  - id: S1
    title: "PEP 646 – Variadic Generics"
    publisher: Python PEPs
    url: https://peps.python.org/pep-0646/
    accessed: 2026-11-19
    license: "Public-Domain"
  - id: S2
    title: "typing — Support for type hints"
    publisher: Python docs
    url: https://docs.python.org/3/library/typing.html
    accessed: 2026-11-19
    license: "PSF-2.0"
---
# Parameterize a generic with typing.TypeVarTuple
**Answer:** `TypeVarTuple` is a type variable tuple: a specialized form of type variable that enables variadic generics. PEP 646 introduces it so a generic can be parameterised with an arbitrary number of types, not just a single `TypeVar`.

## Variadic generics

PEP 484 introduced `TypeVar`, enabling creation of generics parameterised with a single type. `TypeVarTuple` enables variadic generics. In particular, it allows array-like structures in numerical computing libraries to be parameterised with the array shape.

## Declaring and unpacking

Type variable tuples can be declared in a type parameter list or with `TypeVarTuple("name")`. They must always be unpacked. The typing page and the PEP both describe `Unpack` for backwards compatibility with earlier syntax. A `TypeVarTuple` is not a single `TypeVar`.

| TypeVar | TypeVarTuple |
|---|---|
| TypeVar | Parameterises a generic with a single type |
| TypeVarTuple | Parameterises with an arbitrary number of types |
| Unpack | Backwards-compatible unpacking syntax |
| array shape | Motivating case in numerical libraries |

## See also

- [python-typing-annotations](https://iinventedlight.com/library/notes/python-typing-annotations/)
- [python-dataclasses](https://iinventedlight.com/library/notes/python-dataclasses/)
- [python-list-comprehensions](https://iinventedlight.com/library/notes/python-list-comprehensions/)

## Claims

- id: C1
  claim: TypeVarTuple parameterizes a generic with an arbitrary number of types.
  source: S1
  evidence: "enabling parameterisation with an arbitrary number of types"

- id: C2
  claim: That variadic type variable enables variadic generics, including array shapes.
  source: S1
  evidence: "a variadic type variable, enabling variadic generics"

- id: C3
  claim: In typing, TypeVarTuple is a type variable tuple for variadic generics.
  source: S2
  evidence: "A specialized form of type variable that enables variadic generics"

## Sources

- [S1] PEP 646 – Variadic Generics. Python PEPs. https://peps.python.org/pep-0646/ . License: Public-Domain. Accessed 2026-11-19.

- [S2] typing — Support for type hints. Python docs. https://docs.python.org/3/library/typing.html . License: PSF-2.0. Accessed 2026-11-19.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python PEPs, PEP 646 – Variadic Generics; Python docs, typing — Support for type hints. Public-Domain; PSF-2.0. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
