close
Skip to content

Releases: facebook/pyrefly

Pyrefly v0.62.0

20 Apr 17:13

Choose a tag to compare

Pyrefly v0.61.1

17 Apr 18:48

Choose a tag to compare

Pyrefly v0.61.0

13 Apr 20:07

Choose a tag to compare

Pyrefly v0.60.2

10 Apr 18:00

Choose a tag to compare

Fixes exponential memory usage on unannotated dictionaries in 0.60.1.

Full Changelog: 0.60.1...0.60.2

Pyrefly v0.60.1

09 Apr 20:03

Choose a tag to compare

Pyrefly v0.60.0

06 Apr 19:58

Choose a tag to compare

Pyrefly v0.59.1

01 Apr 22:04

Choose a tag to compare

Fixed a performance regression in 0.59.0.

Full Changelog: 0.59.0...0.59.1

Pyrefly v0.59.0

31 Mar 19:56

Choose a tag to compare

Status : Beta
Release date: March 30, 2026

Pyrefly v0.59.0 bundles 153 commits from 20 contributors.


✨ New & Improved

Area What’s new
Type Checking - You can now use while...else statements with returns in the else clause without triggering a false positive missing-explicit-return error.

- Pyrefly now correctly handles type inference for nested empty dictionaries when constructing TypedDict instances, avoiding implicit-any errors.

- Error messages now highlight related code with inline labels; for example, an unsupported * operation will show the types of both operands directly in the source snippet
Language Server - LSP hover information for classes now displays constructor signature and docstring.

- Support additional LSP functionality for notebooks, including find-references and rename.
Performance - Faster typechecking in large pythonc codebases, up to 2x faster on recent benchmarks on real world projects

- Reduced CPU usage through smarter caching of module resolution results

- Improved performance of the LSP server by reducing redundant workspace diagnostic publishes.

🐛 bug fixes

We closed 16 bug issues this release 👏

  • #2026: Fixed an issue where recursive bounded generics were incorrectly reported as object, ensuring accurate type checking.
  • #2812: Resolved a false positive invalid-type-var error when persisting the get method of a fully-annotated dict.
  • #2804: Fixed an implicit-any false positive that occurred with TypedDict items, improving code readability.
  • #2868: Pyrefly now correctly recognizes while...else statements with returns in the else clause as exhaustive.
  • #2814: Enhanced hover information for datetime.datetime imports to display constructor signatures and docstrings.
  • #2896: Fixed a bad-argument-type error that occurred when using double-underscore arguments.
  • #2893: Pyrefly now correctly handles dict Literal key types as subtypes of str key types.
  • #2865: Resolved an issue where tuple subclasses with overridden __getitem__ were not recognized.
  • #2871: Fixed a false positive error when using isinstance with type | X.
  • And more! #2444, #1270, #2900, #2862, #2853

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

@rchen152, @lolpack, @yangdanny97, @stroxler, @samwgoldman, @jvansch1, @kinto0, @connernilsen, @asukaminato0721, @migeed-z, @arthaud, @grievejia, @rubmary, @Adist319, David Tolnay, @yslim-030622, @tejasreddyvepala, @mvanhorn, @MountainGod2


Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed. Highlights from patch release changes that were shipped after the previous minor release are incorporated here as well.

Pyrefly v0.57.1

18 Mar 20:45

Choose a tag to compare

Fixed a bug that could cause Pyrefly to hang.

Pyrefly v0.57.0

18 Mar 15:50

Choose a tag to compare

Status: Beta
Release date: March 16, 2026

Pyrefly 0.57.0 bundles 116 commits from 17 contributors.


✨ New & Improved

Area What’s new
Type Checking - Improved type narrowing for hasattr inside loops

- pyrefly suppress no longer corrupts multiline f-strings/t-strings by inserting suppression comments inside the string; it now places comments above the string and also matches suppressions correctly for errors inside multiline f/t-strings

- Improved namedtuple support with * field unpacking

- Fewer false-positive “variable is not initialized” errors
Language Server - if a nested pyproject.toml contains [tool.ruff] / [tool.mypy] / [tool.pyright], it’s treated as a strong “this is a Python project root” marker, preventing parent pyrefly.toml from incorrectly shadowing it (notably improving go-to-def accuracy on some repos)
Performance - Typechecking speed has improved, making it now ~20% faster to type check Pytorch on recent benchmarks

🐛 bug fixes

We closed 24 bug issues this release 👏

  • #2696: Fixed an issue where Pyrefly’s LSP incorrectly flagged from typing import NewType as unused, even when NewType(...) was referenced.
  • #2743: Fixed an issue where TypedDict fields named items/values prevented access to the corresponding dict.items() / dict.values() methods via attribute lookup.
  • #2745: Fixed an issue where chained/nested narrowing expressions (e.g. multi-clause and conditions) failed to narrow correctly when using negative subscript indices.
  • #2737: Fixed an issue where functools.partial(...) results couldn’t be assigned back to a Callable typed with a ParamSpec, causing a false-positive type error.
  • #2650: Fixed an issue where a Protocol parameterized by ParamSpec[...] wasn’t considered compatible with an equivalent “gradual” protocol using *args: Any, **kwargs: Any.
  • #2334: Fixed an issue where calling __init__ on parametrized bound methods could trigger a false-positive type error due to incorrect attribute lookup behavior.
  • #2731: Fixed an issue where super() calls to abstract methods that do have a concrete runtime body were incorrectly reported as missing-attribute / abstract-call errors.
  • #828: Fixed an issue where reading a conditionally-initialized variable didn’t “commit” the initialization, leading to redundant follow-on “may be uninitialized” errors.
  • #835: Fixed an issue where type information for subclasses wasn’t handled correctly, leading to failures when type-checking subclass relationships.
  • And more! #2522, #1800, #2736, #2382, #913, #1397, #2261, #2669, #2744, #2739, #1575, #903, #1043, #1429, #2607

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.57.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, @grievejia, @yangdanny97, @migeed-z, @jvansch1, @rchen152, @asukaminato0721, @maggiemoss, @arthaud, @lolpack, @samwgoldman, @Adist319, David Tolnay, @avikchaudhuri, @rubmary, @javabster


Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed. Highlights from patch release changes that were shipped after the previous minor release are incorporated here as well.