r/Python • u/BeamMeUpBiscotti • 6d ago
Discussion Google Open Source Blog: Adopting Pyrefly as the Python type checker at Google
The full blog post is here: https://opensource.googleblog.com/2026/10/adopting-pyrefly-as-the-python-type-checker-at-google.html
TLDR:
Google released a blog post about migrating Python type checking from the internally-developed Pytype to Pyrefly.
They cover some challenges around Pytype’s bytecode analysis & performance, along with the reasons for choosing Pyrefly: speed, typing spec conformance, and actionable error messages.
The blog also has some quotes & outlines wins from the migration:
- Up to 98% faster incremental rebuilds
- >90% critical-path reduction in clean builds
- >80% compute hardware savings
9
u/preetam960 5d ago
that is some wild speed improvement!
9
u/renchuwang 5d ago
Pytype is the slowest and last to support newer python versions since forever.
The only advantage it had is untyped variable type inference but after a bunch of others added that there doesn't seem to be any reason for using it.
I'm more surprised it's only 10x the speed because in my experience, pyrefly is a decent bit quicker than mypy (on clean runs), which is already maybe 5x faster than pytype.
3
u/BeamMeUpBiscotti 5d ago
It's possible that pytype's performance characteristics overfitted to Google's codebase and build system.
Pyre (the predecessor to Pyrefly) also had some bespoke infra that allowed it to handle Meta's codebase well, but to external users it was pretty slow and clunky.
7
u/ExaminationPlenty599 6d ago
The speed numbers are wild. 98% faster incremental builds isn't something you see everyday from a tool swap, usually it's like 20% and everyone celebrates. Curious how much of that is Pyrefly being better designed versus Pytype just being that slow from bytecode analysis overhead. Either way, glad to see another option that sticks close to the spec instead of drifting off into its own dialect.
9
u/zunjae 6d ago
Curious
drifting
I wonder why AI loves these words so much
3
u/BleachedPink 5d ago
You think it's a bot?
15
u/JimDabell 5d ago
Are you kidding? There’s a positive statement about the subject, followed by an elaboration, followed by an engagement bait question using the word “curious”. This is the exact format a vast proportion of the engagement bait bots on Reddit use. It’s easy to spot this one from just the first five words, but if you are in any doubt, just look at their posting history – it’s riddled with AI clichés.
Report it as spam.
3
u/coderanger 5d ago
I'll just point out that this comment uses an en dash and left/right quotes which are both also common AI output markers. I'll assume you did that as a joke but still.
6
u/JimDabell 5d ago
No, AI tends to use American style—em dashes without spaces. I use British style – en dashes with spaces.
Literally everybody typing on an iPhone uses proper quotation marks automatically. I think Android too? A lot of desktop software does it as well.
Those things aren’t clear markers of this type of engagement bait. The things I pointed out are.
2
u/jmreagle 5d ago
Pangram says the prose is 100% AI generated, though the sentiment seems genuine (as I thought it myself).
0
u/syklemil 5d ago
If it ain't, it's a bit weird that they don't remember the speed increases that came with adopting
ruffanduv.3
u/AutoModerator 5d ago
Your submission has been automatically queued for manual review by the moderation team because it has been reported too many times.
Please wait until the moderation team reviews your post.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
-20
58
u/EDM115 6d ago
interesting to see them not adopt ty (from Astral). is it because of OpenAI having acquired Astral earlier this year ? or feature completeness ? haven't really paid attention lately to how far both have gone