Pyrefly
An open-source Python static type checker developed by Meta, implemented in Rust. It provides high performance and cross-environment consistency, allowing the same engine to be used for type checking in editors, terminals, and CI pipelines.
Timeline (last 90 days)
Zed added Pyrefly to the built-in list as an optional Python language server, which users can enable in Python's language_servers setting (PR #44262).
Pyrefly aims to provide type checking an order of magnitude faster than mypy and Pyright, and to support full type inference, generics, and the new PEP 695 syntax.
Pyrefly's type checking rules are not entirely consistent with Pyright's, so migrating a project may require handling newly appearing diagnostics.
Pyrefly can be installed via uv add pyrefly or pip install pyrefly, and an entire project can be scanned by running uv run pyrefly check.
If no configuration file is present in a project, Pyrefly runs in basic mode and only checks for the most severe type issues; a configuration file must be added for more aggressive checks.
Pyrefly is a Python static type checker created by Meta by rewriting its former OCaml-based type checker Pyre in Rust.
In speed tests, Pyrefly checked PyTorch in 3.7 seconds versus MyPy's 54.92 seconds (approximately 15× faster), checked NumPy in 20 seconds versus MyPy's 1 minute 49 seconds, and checked scikit-learn in approximately 1 second versus MyPy's approximately 6.3 seconds (approximately 6× faster).
Pyrefly can be integrated into an AI agent's work loop by adding a CLI skill and an agents.md file, causing the model to run a check after each change.
Static checkers still require type annotations in the code to be effective; when there are no type annotations at all, Pyrefly will display 0 errors.
Pyrefly's key feature is that the editor, terminal, and CI all use the same engine, so the results from the three never contradict each other.
1 more timeline events
All Facts (10)
Pyrefly's type checking rules are not entirely consistent with Pyright's, so migrating a project may require handling newly appearing diagnostics.
50%UnverifiedPyrefly aims to provide type checking an order of magnitude faster than mypy and Pyright, and to support full type inference, generics, and the new PEP 695 syntax.
50%UnverifiedPyrefly can be installed via uv add pyrefly or pip install pyrefly, and an entire project can be scanned by running uv run pyrefly check.
50%UnverifiedIf no configuration file is present in a project, Pyrefly runs in basic mode and only checks for the most severe type issues; a configuration file must be added for more aggressive checks.
50%UnverifiedStatic checkers still require type annotations in the code to be effective; when there are no type annotations at all, Pyrefly will display 0 errors.
50%UnverifiedPyrefly is a Python static type checker created by Meta by rewriting its former OCaml-based type checker Pyre in Rust.
50%UnverifiedPyrefly can be integrated into an AI agent's work loop by adding a CLI skill and an agents.md file, causing the model to run a check after each change.
50%UnverifiedIn speed tests, Pyrefly checked PyTorch in 3.7 seconds versus MyPy's 54.92 seconds (approximately 15× faster), checked NumPy in 20 seconds versus MyPy's 1 minute 49 seconds, and checked scikit-learn in approximately 1 second versus MyPy's approximately 6.3 seconds (approximately 6× faster).
50%UnverifiedPyrefly's key feature is that the editor, terminal, and CI all use the same engine, so the results from the three never contradict each other.
50%UnverifiedZed added Pyrefly to the built-in list as an optional Python language server, which users can enable in Python's language_servers setting (PR #44262).
50%