Package-level reference for mypy on PyPI — install variants, Python compat, the types-* stub-package ecosystem, and alternatives.
Package-level reference for typing-extensions on PyPI — what's backported, install, version policy, and migration to stdlib.
Define typed data containers with @dataclass — frozen, slots, kw_only, default_factory, __post_init__, asdict, replace, and how it compares to attrs, pydantic, NamedTuple, TypedDict.
Go beyond list[int] and str | None. Covers Protocol, TypeVar bounds, ParamSpec, Concatenate, Self, Annotated, TypedDict with NotRequired/Required, TypeAlias, TypeGuard, TypeIs, cast, assert_type, and reveal_type.
Catch type errors before runtime with mypy. Covers strict mode, common error codes, type: ignore annotations, gradual typing, and pyproject.toml configuration.
navigation
actions
cheat sheet pages