github facebook/pyrefly 0.49.0
Pyrefly v0.49.0

7 hours ago

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 👏

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:

  1. pyrefly check --suppress-errors
  2. run your code formatter of choice
  3. pyrefly check --remove-unused-ignores
  4. 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

Don't miss a new pyrefly release

NewReleases is sending notifications on new releases.