Skip to content
Latchkey

mypy vs Pyright: Which Python Type Checker for CI?

mypy is the reference Python type checker; Pyright is a fast, strict checker that also powers Pylance in VS Code.

mypy is the original, widely-used static type checker for Python, maintained alongside the typing standards. Pyright (from Microsoft) is a fast TypeScript-implemented checker known for strong inference, speed, and tight VS Code integration via Pylance.

mypyPyright
SpeedModerateFast (incremental, watch mode)
InferenceGoodStrong
Editor integrationVia plugins/LSPNative (Pylance/VS Code)
Strictness controlsGranular flagsGranular, strict mode
Reference statusTyping reference implIndependent, widely used

In CI

Both run as a CI gate that fails on type errors. Pyright is generally faster and has strong inference, which can catch issues mypy misses and gives quick feedback; running the same checker in the editor (Pylance) and CI keeps results consistent. mypy is the reference implementation and the closest match to the official typing semantics, with a large body of existing configs and stubs. Some projects run both to maximize coverage.

Choosing for pipelines

Want speed and editor parity with VS Code/Pylance: Pyright. Want the reference checker and closest alignment to typing standards: mypy. Pin the version and the strictness flags in CI so results are reproducible.

The verdict

Want fast checks and editor parity: Pyright. Want the reference checker aligned to typing standards: mypy. Both make solid CI gates - pin versions and strictness, and consider running both for max coverage.

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card