Pyright
Fast, feature-rich Python static type checker from Microsoft. Powers VS Code's Pylance extension. Written in TypeScript for speed — significantly faster than mypy for large codebases. Supports all Python typing features including generics, protocols, TypeVarTuple, ParamSpec, and type narrowing. Can be run standalone or as a language server.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Static analysis tool — no network access during analysis. Safe to run in air-gapped environments.
⚡ Reliability
Best When
Type-checking large Python codebases or projects using VS Code/Pylance where speed and advanced typing support matter.
Avoid When
You're deeply invested in mypy's plugin ecosystem or need exact mypy compatibility for existing tooling.
Use Cases
- • Type-check large Python codebases faster than mypy — Pyright processes large repos in seconds vs mypy's minutes
- • Enable strict type checking in Python projects with granular strictness levels (off, basic, standard, strict)
- • Integrate with VS Code via Pylance for real-time type checking and intelligent code completion
- • Run in CI pipelines with pyright --outputjson for machine-parseable type error output
- • Type-check Python code that uses advanced typing features (TypeVarTuple, overload, ParamSpec) with better inference than mypy
Not For
- • Runtime type checking — Pyright is static analysis only; use beartype or pydantic for runtime validation
- • Python 2 codebases — Pyright targets Python 3.7+ only
- • Projects requiring exact mypy compatibility — some edge cases differ; test both if migrating
Interface
Authentication
CLI tool — no auth needed.
Pricing
MIT licensed open source tool from Microsoft. Pylance (VS Code extension) is a separate proprietary product but Pyright itself is fully open source.
Agent Metadata
Known Gotchas
- ⚠ Pyright and mypy have different inference behaviors for some edge cases — code that passes one may fail the other; test both if cross-compatibility matters
- ⚠ pyrightconfig.json must be in project root — without it, Pyright uses defaults which may not match your project's Python version or import paths
- ⚠ Stub files (.pyi) are preferred over py.typed marker — Pyright resolves type information differently than mypy for some packages
- ⚠ venvPath and venv settings must point to the correct virtual environment — wrong venv causes 'import could not be resolved' for all installed packages
- ⚠ typeCheckingMode: 'strict' enables many rules that may fail on untyped third-party libraries — add reportMissingTypeStubs = 'none' for untyped deps
- ⚠ Pyright does not support mypy plugins — projects relying on mypy plugins (SQLAlchemy, pydantic mypy plugin) need separate configuration
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for Pyright.
Scores are editorial opinions as of 2026-03-06.