github facebook/pyrefly 0.37.0
Pyrefly v0.37.0

20 hours ago

Pyrefly 0.37.0

Status : ALPHA

Release date: 2025-10-14

Pyrefly 0.37.0 bundles 198 commits from 15 contributors. This release brings major improvements to typechecking control flow, overload resolution, Django/enum support, and more.


✨ New & Improved

Area What’s new
Control Flow & Type Narrowing Improve type narrowing across if/else, match, boolean ops, and loops. This enables more precise type inference and fixes several long-standing false positives and negatives.
Overload Resolution Fully implemented the Python typing spec for overload call evaluation, including argument type expansion for unions, bools, enums, tuples, and type. Overloads are now filtered by argument count and variadic-ness, with better error messages and performance.
Django & Enum Support Enhanced Django model field type inference, improved enum attribute handling (including Django enums), and fixed bugs with auto(), Choices, and mixed-in enum data types.
LSP & Editor Features Added inlay hints for function argument names, docstrings for attribute and variable completions, and improved workspace folder detection for LSP clients.

🐛 Bug Fixes

We closed 12 bug issues this release 👏

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.37.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 Pyrefly documentation


🖊️ Contributors this release

@stroxler, @yangdanny97, @arthaud, @connernilsen, @rchen152, @migeed-z, @grievejia, @fangyi-zhou, @kinto0, @fatelei, @ndmitchell, @brosenfeld, @dtolnay, @john Van Schultz


Thank you to everyone who contributed code, bug reports, and feedback!


Full changelog: Comparing 0.36.0...0.37.0

Don't miss a new pyrefly release

NewReleases is sending notifications on new releases.