Status : BETA
Release date: 20 January 2026
Pyrefly v0.49.0 bundles 231 commits from 25 contributors.
✨ New & Improved
| Area | What’s new |
|---|---|
| Type Inference | - Partial type inference now possible in loops - Variance inference for self-referential generic types (PEP 695) - typing.Mapping now recognised as a type alias
|
| Language Server | - Improved refactoring capabilities for moving module members and lifting local functions/methods to top-level module scope, with automatic import/shim creation. - Hover support for in keyword when used in iteration contexts (for-loops and comprehensions), showing the type of the iterable being iterated over - “Go to symbol” now correctly includes methods inside a class - Enabled clickable inlay hints for built-in types like tuple, dict, str, and special forms (TypeVar, ParamSpec, etc.), allowing users to quickly navigate to type definitions in the IDE |
| Pydantic Support | Added detection and support for pydantic.dataclasses.dataclass decorator, including strict and lax mode support for pydantic dataclasses
|
| Error Reporting | Improved error messages for yield, yield from, augmented assignment, missing imports, and missing stubs for better user clarity.
|
🐛 bug fixes
We closed 38 bug issues this week 👏
- #2145 - Fixed variance inference incorrectly using
inferred_varianceinstead ofspecified_variancefor stdlib generic classes likeMapping[str, T]. - #1806 - Fixed improper type narrowing and captured variable typing for sequence patterns (e.g.,
[*values]) in match/case statements. - #1697 - Fixed a bug where Pyrefly got confused if a class had the same name as an overloaded method.
- #1494 - Ensures correct overload resolution when promoting nested tuple element literals for unannotated method-initialized attributes.
- And more: #1481, #1472, #1466, #1385, #1341, #1310, #1277, #1234, #1219, #1208, #1013, #1002, #935, #910, #899, #773, #768, #755, #737, #708, #421, #295, #266, #265, #1503, #1616, #1626, #1803, #2051, #2072, #2077, #2107, #2111, #2161
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.49.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
🖊️ Contributors this release
@aaron-ang, @Adist319, @asukaminato0721, @connernilsen, @yangdanny97, @diliop, @fangyi-zhou, Jack, @grievejia, @jvansch1, @Karman-singh15, @kinto0, @arthaud, @ndmitchell, @rchen152, @samwgoldman, @Sehat1137, @stroxler, @tianhan0, @tannguyencse19, @migeed-z