Skip to content

Pyrefly v0.41.0

Choose a tag to compare

@javabster javabster released this 11 Nov 21:11
· 1540 commits to main since this release

Status : ALPHA
Release date: 10 November 2025

Pyrefly v0.41.0 bundles 166 commits from 22 contributors.


✨ New & Improved

Area What’s new
Jupyter Notebook support - Extensive improvements for language server support in Jupyter Notebooks including diagnostics (red squiggles), inlay hints, go-to-definition, hover, semantic tokens, signature help, and completions

- No extra configuration required to enable language server for notebook files (.ipynb), they are now included by default.
Type Checking - Pyrefly now correctly models and narrows types for variables reassigned within loops, fixing several long-standing issues (#726, #747).

- Improved pattern matching support for certain built-in types, better aligning with typing specification

- More accurate type checking for TypedDicts with union keys
Language Server - Hover cards on variables now link to built in types.

- Unused parameters are now flagged in IDE Deprecated functions now suggested below non-deprecated ones in auto-completions.

- Inlay hints are suppressed for variables with unknown or Any types to reduce noise in IDE
Error messages - Users can now use --info=<error-code> command line flag to set error severity to info for specific error codes.

- Users can now filter summarized errors by specific error codes using pyrefly check --summarize-errors --only <error-code>

🐛 bug fixes

We closed 15 bug issues this release 👏

  • #1505 - fixed incorrect bad-assignment error inside loop with dict.get
  • #1411 - Fixed bad-argument-type false positive when a parameter type was inferred as Never
  • #1327 - Fixed issue where Hover did not show docstring for nested classes
  • #1184 - Fixed a bug where NewType was not treated as a type
  • #1301 - Fix for nested folder imports in the Pyrefly website sandbox
  • #1173 - Fixed issue where VSCode extension import autocomplete included hidden directories
  • And more: #1092, #747, #726, #1407, #1487, #1420, #1417, #1536, #1508, #1487, #1420, #1417

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.41.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 , @alokpr, @AryanBagade, @asukaminato0721, @connernilsen, @yangdanny97, @dtolnay, @kv9898, @fangyi-zhou, @grievejia, @jvansch1, @kshitijgetsac, @maggiemoss, @arthaud, @ndmitchell, @rchen152, @rubmary, @stroxler, @VladimirMakaev, @migeed-z