github facebook/pyrefly 0.38.0
Pyrefly v0.38.0

latest release: 0.38.2
one day ago

Pyrefly 0.38.0

Status : ALPHA

Release date: 2025-10-21

Pyrefly 0.38.0 bundles 126 commits from 14 contributors. This release brings major improvements to typechecking, error reporting, IDE integration, and configuration flexibility, along with a host of bug fixes and performance enhancements.


✨ New & Improved

Area What’s new
Type System - Flow-merging now respects explicit and implicit Any, preventing catastrophic type unions in gradual codebases.
- Added off-by-default error for implicit Any (missing param/return annotations, empty containers).
- Improved handling of strict types and propagation of strictness in type aliases and class bases.
Error Reporting - Diagnostics now include clickable links to error documentation.
- Improved error messages for Protocol & TypedDict mismatches, abstract async iterators, bad tuple subscriptions, and failed x in y checks.
- Renamed several error kinds for clarity (import-errormissing-import, async-errornot-async, delete-errorunsupported-delete, index-errorbad-index, match-errorbad-match, type-alias-errorinvalid-type-alias).
- Added a severity field to JSON output.
IDE & LSP - Unannotated and annotated local variables now appear in VSCode's symbol table.
- Inlay hints and type inference for Any/Unknown are suppressed for clarity.
- Module import completions and quick fixes improved.
- Hovering over # pyrefly: ignore now shows the error that is suppressed by that comment.
Performance & Config - Faster file globbing and directory scanning.
- Default exclusion of hidden directories.
- Improved config override handling for CLI and IG commands.
- Added warning when running pyrefly check on ~ (home directory).

🐛 bug fixes

We closed 12 bug issues this release 👏

Notable bug fixes include:

  • Fixed type checking bugs affecting async iterators, tuple contextual typing, and in checks.
  • Corrected handling of missing source errors for both import a and from a import b.
  • Fixed semantic tokens for variables defined in with and except blocks.
  • Fixed some crashes and errors in the --remove-unused-ignores feature.
  • Addressed issues with class equality in IDE scenarios involving in-memory and on-disk types.
  • Improved handling of deprecated dunder methods and ensured consistent error messages.
  • Resolved issues with module import completions and quick fixes.
  • Addressed bugs in type alias expansion and strictness detection.
  • Fixed control flow bug leading to false positives in for ... else.
  • Fixed formatting for multi-line docstring formatting in VS Code hover.

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

@arthaud, @stroxler, @yangdanny97, @abdallhfattah, @kinto0, @rchen152, @samwgoldman, @migeed-z, @connernilsen, @grievejia, @asukaminato0721, @rubmary, @Adist319, @johnvanschultz


If you have any questions or feedback, please open an issue or join the discussion on GitHub. Thank you for using Pyrefly!

Don't miss a new pyrefly release

NewReleases is sending notifications on new releases.