Modern Python typing, static analysis & CI workflows

Type your Python like the standard library does.

Implementation-first references for modern typing syntax, strict analyzer setup, and CI gates that scale across production Python teams — grounded in the PEPs and the real behaviour of mypy, pyright, and ruff.

  • PEP 604 · 612 · 695
  • TypeVar · Protocol · ParamSpec
  • mypy · pyright · ruff · pre-commit
50 In-depth guides
3 Core knowledge areas
3 Analyzers covered: mypy · pyright · ruff
484→695 PEPs mapped, 484 through 695

Start with a core area

Three core areas cover the typing system end to end — from everyday annotations to the strict CI gates that keep large codebases honest.

What you'll master

Every guide is tool-aware: code blocks name their Python version and analyzer, and error codes are quoted so you can grep your CI log straight to the fix.

Modern syntax, not legacy

Write X | None, list[str] and PEP 695 class Repo[T] — with the legacy equivalents mapped for older runtimes.

Generics that hold up

TypeVar bounds, variance, Protocols, ParamSpec and overloads — modelled the way static analyzers actually resolve them.

Analyzer divergence, decoded

Where mypy and pyright disagree on narrowing, overloads and TypeGuard — and which flag settles it in your config.

Strict CI, incrementally

pre-commit, GitHub Actions and per-package overrides for rolling out --strict on a legacy codebase without a flag day.

Popular topics

Jump straight to a focused area.