Type checkers
Tools that infer and check the type of every value without running the program.
How they work
A type checker reads annotations, infers types where there are none, and reports any place a value can’t have the type the code needs. TypeScript’s tsc does this for JavaScript. In Python, PEP 484 (2014) standardised the annotation syntax but deliberately left checking to separate tools; the interpreter stores annotations and ignores them.
Python therefore has several checkers that agree on the typing specification and differ where it is silent. mypy, started by Jukka Lehtosalo in 2012, was the reference implementation. Microsoft’s Pyright, written in TypeScript, evaluates types lazily so it can power an editor and is often 3 to 5 times faster than mypy on large codebases; basedpyright is a stricter community fork. Two Rust checkers arrived in 2025: Meta’s Pyrefly and Astral’s ty.
Each lets you pick how strict to be (Pyright’s basic, standard and strict modes; Pyrefly’s presets from basic to strict), and each runs as a language server, so the errors CI reports appear in the editor as you type.
Technologies
What all linters, formatters and type checkers have in common →Sources
- TypeScript handbook: The basics (static type-checking, tsc)
- PEP 484: Type hints (created Sep 2014)
- mypy: About (started 2012)
- Pyright docs: Differences between Pyright and mypy
- Pyright docs: Configuration (typeCheckingMode)
- Pyrefly docs: Configuration (presets)
- Pyrefly blog: Introducing Pyrefly (May 2025)
- Astral blog: ty, an extremely fast Python type checker and language server (Dec 2025)
- basedpyright README