
Google spent over a decade building and maintaining Pytype — its own Python type checker. On October 6, the company officially retired it and switched the entire engineering organization to Pyrefly, a type checker built by Meta. That is not a typo. The team that created Pytype decided the smartest move was to adopt a competitor’s tool. Every Python developer working at any scale should understand why.
Why Pytype Had to Go
Pytype had a fundamental architectural flaw baked in from the start: it analyzed compiled bytecode rather than source ASTs. For years, that was manageable. Then Python’s typing system began evolving rapidly — new PEPs, new syntax, new semantics — and bytecode became an increasingly unstable foundation to build on.
The team eventually announced that Python 3.12 would be Pytype’s final supported version. No new features. Bugfixes only. The writing was on the wall long before that, but the numbers make the problem undeniable. On a large machine learning model, Pytype takes up to 246.7 seconds. Pyrefly completes the same check in 1.7 to 4.5 seconds. That is not a performance gap — that is a different category of tool.
The Numbers Make the Case
Google’s internal benchmarks are stark:
- Pyrefly is approximately 10x faster than Pytype overall
- 98% reduction in incremental rebuild latency
- 80%+ reduction in peak compute cost for Python type checking
- 90–99% reduction in type-checking share of the build critical path
Independently, against the broader ecosystem: Pyrefly checks over 1.85 million lines of code per second, runs approximately 15x faster than mypy on the PyTorch codebase, and roughly 17x faster than Pyright. It is written in Rust — the same move Astral made with Ruff and uv — and it shows.
It Already Runs at Scale
Google is not the first large organization to make this call. Pyrefly shipped as v1.0 in May 2026 and was already the default type checker at Instagram. PyTorch and JAX adopted it before Google announced. The fact that Google is following Meta’s lead on a Python developer tool — less than five months after the stable release — is a meaningful endorsement of both the tool’s maturity and Meta’s developer tooling team.
Pyrefly scores approximately 97% on the official Python typing conformance test suite and is actively maintained to track new typing PEPs and Python versions. It is stricter than Pytype in meaningful ways, particularly on unsound unions — where Pytype previously accepted a value typed as int | None in a position expecting only int.
Migration Is Nearly Free — With One Catch
The path to switching is straightforward. Run pyrefly init and it reads your existing mypy.ini or [tool.mypy] configuration and writes an equivalent Pyrefly config. Baseline files keep CI green while you work through any new diagnostics the stricter checker surfaces.
# Install
pip install pyrefly
# Migrate from mypy config
pyrefly init
# Run type check
pyrefly check src/
The catch: Pyrefly will find errors your current setup is missing. That is a feature, not a bug — but plan for a triage pass before you enforce it in CI. The official migration guide covers the full process.
The Bigger Picture
This story is about more than a type checker. Ruff replaced flake8 and pylint at scale. uv replaced pip for speed. Now Pyrefly is replacing the type checkers — and all three are Rust rewrites. The pattern is consistent: Python tools written in Python have hit a performance ceiling. The gap at large codebases is simply too wide to close by optimizing Python.
There is one genuine reason to stay on mypy: plugins. Django, SQLAlchemy, and Pydantic have mature mypy plugins with no direct Pyrefly equivalents yet. If your type checking depends on those, hold off and watch. Astral is also working on red-knot, a Rust-based type checker tied to the Ruff ecosystem — competition that will only push Pyrefly forward faster.
Google replaced its own tool with Meta’s. If that does not prompt your team to at least benchmark Pyrefly against your current setup, nothing will. Read the InfoQ technical breakdown for a deeper look at the migration tradeoffs.

