# Adopting Pyrefly as the Python type checker at Google

DevFeed: [Adopting Pyrefly as the Python type checker at Google](<https://devfeed.tech/articles/adopting-pyrefly-as-the-python-type-checker-at-google-66435.md>)

Original publisher: [Read original article](<http://opensource.googleblog.com/2026/10/adopting-pyrefly-as-the-python-type-checker-at-google.html>)

Author: Google Open Source (noreply@blogger.com)

Published: 2026-10-06T18:30:00Z

Content type: article

Language: en

Sources: [Google Open Source Blog](<https://devfeed.tech/sources/google-open-source-blog.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [typesafety](<https://devfeed.tech/topics/typesafety.md>), [builds](<https://devfeed.tech/topics/builds.md>), [Google](<https://devfeed.tech/topics/google.md>)

Tags: [addition](<https://devfeed.tech/tags/addition.md>), [adopting](<https://devfeed.tech/tags/adopting.md>), [agents](<https://devfeed.tech/tags/agents.md>), [alternatives](<https://devfeed.tech/tags/alternatives.md>), [away](<https://devfeed.tech/tags/away.md>), [benchmarks](<https://devfeed.tech/tags/benchmarks.md>), [build](<https://devfeed.tech/tags/build.md>), [build-system](<https://devfeed.tech/tags/build-system.md>), [bytecode](<https://devfeed.tech/tags/bytecode.md>), [challenges](<https://devfeed.tech/tags/challenges.md>), [code](<https://devfeed.tech/tags/code.md>), [collective](<https://devfeed.tech/tags/collective.md>), [community](<https://devfeed.tech/tags/community.md>), [compute](<https://devfeed.tech/tags/compute.md>), [compute-resources](<https://devfeed.tech/tags/compute-resources.md>), [data](<https://devfeed.tech/tags/data.md>), [developer-tools](<https://devfeed.tech/tags/developer-tools.md>), [google](<https://devfeed.tech/tags/google.md>), [meta](<https://devfeed.tech/tags/meta.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [pyrefly](<https://devfeed.tech/tags/pyrefly.md>), [python](<https://devfeed.tech/tags/python.md>), [type](<https://devfeed.tech/tags/type.md>)

## AI overview

Google adopted Meta's open source Pyrefly as its Python type checker after deciding Pytype would stop supporting versions after Python 3.12. Google says Pytype's bytecode-based design made it harder to keep up with typing changes and deliver fast feedback. In internal benchmarks, Rust-based Pyrefly was about ten times faster, scored roughly 97% on the typing conformance suite, and reduced warm incremental rebuild latency by up to 98%. Cold-cache builds saw a 90-99% reduction in type checking's share of the critical path, while peak compute occupancy fell by more than 80%. Pyrefly also enforces sound union checks that Pytype historically allowed through, and provides inline diagnostics with occasional suggested fixes.

## Source excerpt

by Amer Elsheikh, Python Team Python is one of the primary languages at Google, powering everything from machine learning research to developer infrastructure and data pipelines. Across hundreds of thousands of files in our monorepo, fast and reliable static type checking is essential for maintaining code safety and developer velocity. Today, Pyrefly--an open source type checker developed by Meta--is the Python type checker at Google. Replacing our previous type-checking infrastructure with Pyrefly provided significant speedups for engineers and agents alike, while substantially reducing build-system compute resources. Moving away from Pytype For more than a decade, Google relied on Pytype, an internally developed type checker that pioneered Python type checking and collaborated with the open source community to create typeshed. However, as Python's typing system evolved rapidly, Pytype faced fundamental challenges. Because it operated by analyzing compiled bytecode rather than source ASTs, keeping pace with modern typing PEPs became an increasing maintenance burden due to bytecode instability across Python releases. In addition, it struggled to deliver the fast turnaround times required for modern development loops. As detailed in the Pytype update, we decided that Python 3.12 would be the final supported version for Pytype, leading us to evaluate and adopt modern open source alternatives. Why Pyrefly? Pyrefly incorporates years of collective lessons from earlier tools across the Python typing ecosystem. When evaluating candidates to succeed Pytype, Pyrefly quickly stood out across three key areas: Performance Written in Rust, Pyrefly is designed for high throughput and lazy, parallel evaluation. In our internal benchmarks across various Google projects, it proved to be an order of magnitude faster than Pytype, while scaling smoothly across large dependency graphs. Typing spec conformance Pyrefly achieves strong conformance--scoring roughly 97% on the official typing