Forward a callable's parameters with typing.ParamSpec
Answer: ParamSpec is a parameter specification variable, a specialized version of type variables. PEP 612 proposes typing.ParamSpec and typing.Concatenate so you can forward the parameter types of one callable over to another callable, which is what decorator annotations need.
Why Callable was not enough
There currently are two ways to specify the type of a callable: the Callable syntax from PEP 484, and callback protocols from PEP 544. Neither of these support forwarding those parameter types.
In type parameter lists
In type parameter lists, parameter specifications can be declared in the new 3.12 syntax as well as with ParamSpec("name"). Concatenate is proposed together with ParamSpec. A Callable argument list can also be a ParamSpec, Concatenate, or an ellipsis (...).
| ParamSpec | Concatenate | |---|---| | ParamSpec | Parameter specification variable | | Concatenate | Adds parameters in front of a ParamSpec | | Callable | Cannot forward parameter types by itself | | decorator | Difficult to annotate without ParamSpec |
See also
Claims
- id: C1 claim: PEP 612 adds ParamSpec and Concatenate so one callable can forward another's parameter types. source: S1 evidence: "This PEP proposes typing.ParamSpec and typing.Concatenate"
- id: C2 claim: Neither Callable nor callback protocols could forward parameter types on their own. source: S1 evidence: "Neither of these support forwarding the parameter types of one callable"
- id: C3 claim: ParamSpec is a parameter specification variable, a specialized version of type variables. source: S2 evidence: "A specialized version of type variables"
Sources
- [S1] PEP 612 – Parameter Specification Variables. Python PEPs. https://peps.python.org/pep-0612/ . 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 612 – Parameter Specification Variables; Python docs, typing — Support for type hints. Public-Domain; PSF-2.0. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python PEPs, PEP 612 – Parameter Specification Variables; Python docs, typing — Support for type hints. Public-Domain; PSF-2.0.
Cite this
iinventedlight. 2026. "Forward a callable's parameters with typing.ParamSpec." iinventedlight Library, iil:note:qajc5avr, version of 2026-11-19. https://iinventedlight.com/library/notes/python-typing-paramspec/. License: CC-BY-4.0.
@misc{iil_note_qajc5avr,
author = {{iinventedlight}},
title = {{Forward a callable's parameters with typing.ParamSpec}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-19},
url = {https://iinventedlight.com/library/notes/python-typing-paramspec/},
note = {Permanent ID iil:note:qajc5avr. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- python-typing-paramspec.table.json (table; CC-BY-4.0)
- python-typing-paramspec.schema.json (schema; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-typing-paramspec.md.