Pyrefly 0.53.0
Status : BETA
Release date: 17 February 2026
pyrefly 0.53.0 bundles 245 commits from 27 contributors.
✨ New & Improved
| Area | What’s new |
|---|---|
| Type Checking | - Recursive type aliases now supported, so you can define type aliases that reference themselves, and Pyrefly will correctly resolve and type-check them - Error is now raised when Self is used in certain invalid locations (outside a class, in a static method within a class, in a metaclass) - Pyrefly now supports the idiom class Foo(namedtuple("Bar", ...)), matching CPython and Mypy behavior - Pyrefly will now warn you if a protocol’s type variable is used in a way that doesn’t match its declared variance |
| Language Server | - Completion suggestions are now ranked based on most recently used (MRU) items - Auto-import completions and unknown-name quick fixes now honor common aliases (e.g. import numpy as np) - Improved error messages for signature mismatches, including ASCII-style diffs and normalized function names for clarity |
| Config | - JSON schemas added for pyrefly.toml and pyproject.toml to enable editor features like auto-completion and validation
|
| Performance | - Pyrefly uses ~26% less CPU when tested typechecking the whole Pytorch codebase on M1 Pro MacBook with 10 cores |
🐛 bug fixes
We closed 17 bug issues this release 👏
- #949 - Lambdas with
yieldoryield fromare now correctly inferred as generator-returning callables. - #2407 -
Literalimported viatry/exceptis now recognized as a special form, preventing spurious unknown-name errors - #2375 - Methods overriding base class methods no longer trigger false positive errors for missing
@overridedecorators. - #2327 - The first parameter of class methods is now correctly handled regardless of its name.
- And more - #1754, #1383, #1790, #2350, #2369, #2371, #2392, #2335, #259, #254, #1778, #2116, #2302
Thank-you to all our contributors who found these bugs and reported them! Did you know this is one of the most helpful contributions you can make to an open-source project? If you find any bugs in Pyrefly we want to know about them! Please open a bug report issue here
📦 Upgrade
pip install --upgrade pyrefly==0.53.0
How to safely upgrade your codebase
Upgrading the version of Pyrefly you're using or a third-party library you depend on can reveal new type errors in your code. Fixing them all at once is often unrealistic. We've written scripts to help you temporarily silence them. After upgrading, follow these steps:
pyrefly check --suppress-errors- run your code formatter of choice
pyrefly check --remove-unused-ignores- Repeat until you achieve a clean formatting run and a clean type check.
This will add # pyrefly: ignore comments to your code, enabling you to silence errors and return to fix them later. This can make the process of upgrading a large codebase much more manageable.
Read more about error suppressions in the [Pyefly documentation](https://pyrefly.org/en/docs/error-suppressions/)
🖊️ Contributors this release
@stroxler, @rchen152, @yangdanny97, @asukaminato0721, @samwgoldman, @kinto0, @connernilsen, @grievejia, @fangyi-zhou, @migeed-z, @ndmitchell, @jackulau, @jvansch1, @rubmary, @alanhdu, @avikchaudhuri, @arthaud, @DanielNoord, @diliop, @ipr-ams, @javabster, @oopscompiled, @Prathamesh-tech-eng, @self-sasi, @dtolnay, Vladimir Matveev, Robert Rusch