← All notes

TypedDict describes a dict with a fixed set of typed keys

Answer: TypedDict is a special construct to add type hints to a dictionary. Each key is associated with a value of a consistent type. At runtime TypedDict instances are simply dicts. TypedDict declares a dictionary type with a certain set of keys. This expectation is not checked at runtime but is only enforced by type checkers.

PEP 589

This PEP proposes a type constructor typing.TypedDict. It supports a dictionary object that has a specific set of string keys. Each of those keys has a value of a specific type. The example movie dict has 'name': 'Blade Runner' and 'year': 1982. A common form is class Point2D(TypedDict) with fields such as x: int.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python docs, typing.TypedDict, PSF-2.0 (https://docs.python.org/3/license.html); Python PEPs, PEP 589 – TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys, Public domain or CC0-1.0 (https://peps.python.org/pep-0589/ (Copyright section: public domain)). Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python docs, typing.TypedDict, PSF-2.0 (https://docs.python.org/3/license.html); Python PEPs, PEP 589 – TypedDict: Type Hints for Dictionaries with a Fixed Set of Keys, Public domain or CC0-1.0 (https://peps.python.org/pep-0589/ (Copyright section: public domain)).

Cite this

Permanent ID: iil:note:mpsnc99n

iinventedlight. 2026. "TypedDict describes a dict with a fixed set of typed keys." iinventedlight Library, iil:note:mpsnc99n, version of 2026-11-16. https://iinventedlight.com/library/notes/python-typeddict/. License: CC-BY-4.0.

@misc{iil_note_mpsnc99n,
  author = {{iinventedlight}},
  title = {{TypedDict describes a dict with a fixed set of typed keys}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/python-typeddict/},
  note = {Permanent ID iil:note:mpsnc99n. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-typeddict.md.