github facebook/pyrefly 0.40.0
Pyrefly v0.40.0

17 hours ago

Status : ALPHA
Release date: 03 November 2025

Pyrefly v0.40.0 bundles 143 commits from 26 contributors.


✨ New & Improved

Area What’s new
Language Server - Go-to definition / hover to overloads on operators like ==

- Fold on docstrings

- New LSP configuration arguments added allowing users to enable/disable specific IDE features like Go-to-definition, Autocomplete, and Hover tooltips. See docs here for details.

- Unreachable code will now be grayed out.

- Fixed bug with symlinked paths in VSCode
Type Resolution Implemented a TypeCache to significantly optimize is_subtype queries by caching resolved types. This leads to faster type checks and a more responsive IDE experience.
Error Reporting Introduced a new FindError that will inform a user when there is a stub available for a package that they do not have installed. The default severity level for this will be a warning.
Django Integration Continued work on Django support, including improved type inference for lazy enum labels
Jupyter Notebook support Basic type checking support (pyrefly check path/to/file.ipynb) now available for jupyter notebooks. Still very experimental, further improvements coming soon

🐛 bug fixes

We closed 15 bug issues this release 👏

  • #1414 - Ensured typing_extensions.dataclass_transform works correctly.
  • #1351 - Correctly accept TypedDict as Partial when unpacking one TypedDict into another and detect more open-unpacking errors.
  • #1257 - Addressed a crash related to Var::ZERO during autocomplete by using deep_force to replace unsolved variables with Unknown.
  • #1104 - Resolved an issue where the VSCode extension did not highlight problems in files with symlinked paths under Linux
  • #1045 - Addressed a false-positive in raise..from statements by correctly handling None when it appears in a union
  • And more: #1412, #1409, #1405, #1396, #1356, #1294, #1288, #1234, #1145, #1119

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.40.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

@ndmitchell, @rchen152, @arthaud, @yangdanny97, @stroxler, @kinto0, @samwgoldman, @connernilsen, @grievejia, @tianhan0, , @rubmary, @nhawkes, @diliop, @migeed-z, @jvansch1, @vladima, @lolpack, @asukaminato0721, @dtolnay, @kv9898, @maggiemoss, @michaelcortese, Anqi Wu, Willy Lau

Don't miss a new pyrefly release

NewReleases is sending notifications on new releases.