github facebook/pyrefly 0.45.0
Pyrefly v0.45.0

latest releases: 0.45.2, 0.45.1
2 days ago

Status : BETA
Release date: 08 December 2025

Pyrefly v0.45.0 bundles 146 commits from 21 contributors.


✨ New & Improved

Area What’s new
Type Checking - For dict literals without a contextual hint Pyrefly will now infer an anonymous typed dict. This reduces false positives when unpacking a heterogeneous dict as kwargs.

- Better suggestions hints for name and attribute errors (e.g. suggesting fixes to one letter errors like my_variublemy_variable).

- Callable types are now narrowed more intuitively, especially in isinstance checks. Callable Enums are also now supported

- New check added (defaults to warn) for comparisons where the result is predictable or the comparison inappropriate (e.g. True is False). Reflects basic support for Pyright’s reportUnnecessaryComparison and Mypy’s comparison-overlap check.
Language Server Automatic file renaming improved to allow editable third party packages to be renamed
Third Party Package Support - Support for Pydantic lax mode has been extended to include support for container types (lists, dicts etc.)

- All Django fields now support nullability, fixing issues with TextField and others

- Pyrefly will now correctly infer the signature for functions decorated with numba.jit and numba.njit

🐛 bug fixes

We closed 19 bug issues this release 👏

  • #1736 - Fixed prepareRename LSP request to allow renaming of symbols from editable packages
  • #1732 - Fixed handling of await inside async comprehensions at module scope
  • #1686 - Fixed highlighting for Chinese and other multi-byte characters by using UTF-16 encoding for semantic token offsets
  • #1632 - Fixed tracking of unresolvable modules, ensuring type errors are updated when import errors change
  • #1565 - Fixed false positive type errors in nested loops by correctly handling LoopRecursive variables in type checking.
  • #204 - Fixed missing error when __all__ is not implemented, now validating user-defined __all__ entries and emitting errors for missing module attributes
  • And more: #1773, #1765, #1742, #1739, #1720, #1698, #1624, #1479, #1475, #1325, #1289, #974, #548

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

@stroxler, @migeed-z, @rchen152, @yangdanny97, @samwgoldman, @connernilsen, @asukaminato0721, @kinto0, @grievejia, @arthaud, @AryanBagade, @lolpack, @ndmitchell, @gvozdvmozgu, @javabster, @KaranPradhan266, @jvansch1, @tianhan0, Owen Valentine, Vladimir Matveev

Don't miss a new pyrefly release

NewReleases is sending notifications on new releases.