Google Sunsets Pytype: The End of an Era for Python Type Checking
Updated November 12, 2026: Google announced its adoption of Pyrefly on October 6. Its Python style guide now names Pyrefly in place of Pytype as an example checker. Pyrefly is stable and is the handbook’s recommended type checker for new projects.
Google ended Pytype’s Python support at 3.12, shifting its investment toward other typing approaches. The original retirement announcement left its replacement unnamed; Google has since chosen Pyrefly for its Python monorepo.
Why Google moved away from Pytype
Pytype analyzed compiled Python bytecode. Google attributes its maintenance burden to bytecode changes across Python releases and the difficulty of keeping up with Python’s typing specification. Slow feedback also made it harder to support interactive development.
The replacement changes more than check times. Google reports that Pyrefly rejects some union-type arguments Pytype accepted. For example, passing an int | None value to a function expecting int requires handling the None case first. A migration needs diagnostic review even when existing annotations stay the same.
Choose a maintained type checker
For new projects, start with Pyrefly. For existing projects, weigh configuration, editor support, and diagnostic differences before switching:
- mypy: Keep it when existing configuration or plugins meet the project’s needs.
- pyright: Consider it for projects that depend on Microsoft’s Pylance editor integration.
- Pyrefly: Meta’s stable type checker and language server, also deployed at Google.
- ty: A type checker and language server built by Astral, with incremental analysis for editor feedback.
The type-checker comparison covers their trade-offs. For a project adopting checks gradually, incremental type-checking guidance explains how to keep existing errors from blocking new work.