Skip to content

Releases: facebook/pyrefly

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.

v0.56.0

11 Mar 13:57

Choose a tag to compare

Pyrefly v0.56.0

Status : Beta
Release date: March 09, 2026
Pyrefly v0.56.0 bundles 248 commits from 22 contributors.


✨ New & Improved

Area What’s new
Type Checking - Limit the width of inferred return types to prevent large unions.

- Comparison checks involving Any now yields Any (not bool), matching gradual typing expectations and avoiding overly-confident boolean results
Language Server - IDE diagnosticMode now includes an experimental workspace mode. When set to workspace, Pyrefly publishes diagnostics for all files in a project once any file from that project is opened.

- Support added for the TSP typeServer/getPythonSearchPaths message.

- Relative imports now work for go-to-definition and completions (including site-packages), reducing “can’t resolve import” / missing navigation cases
Type Errors - Default severities have been tuned to reduce noise: implicit-import errors downgraded to warning; unreachable and redundant-condition errors default to warning (are configurable back to errors if desired)

- New error code `non-convergent-recursion`, read the docs
Performance Improvements - Added dedicated thread pool for LSP operations to prevent blocking main thread during rechecks

🐛 bug fixes

We closed 33 bug issues this release 👏

  • #2612: Fixed an issue where lambda expressions with default parameters were not recognized in missing-argument checks.
  • #2605: Fixed a false positive error in an untyped classmethod with *args.
  • #2385: Prevented builtins wildcard imports from shadowing existing definitions during static scope setup.
  • #2618: Fixed a StrEnum classmethod being treated as enum members.
  • #2590: Blocked subscripting generic functions/callables to prevent unsupported operations.
  • #2514: Fixed a not-callable false positive with enum methods.
  • #2609: Fixed a bad-param-name-override false positive for Sequence.__contains__.
  • #2668: Fixed dict.setdefault on an unpinned dict always making the dict nullable.
  • #2527: Fixed a no-matching-overload issue related to nested type aliases.
  • #2543: Fixed a problem when using class definition on top of a ClassVar.
  • And more!

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.56.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, @rchen152, @kinto0, @grievejia, @yangdanny97, @samwgoldman, @jvansch1, @asukaminato0721, @rubmary, @migeed-z, @connernilsen, @avikchaudhuri, @fangyi-zhou, @arthaud, @rchiodo, @Karman-singh15, @MarcoGorelli, @lolpack, @pswitchy, @michel-slm, Jaimin Brahmbhatt, @maggiemoss


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

03 Mar 20:23

Choose a tag to compare

Status : Released
Release date: March 03, 2026

Pyrefly v0.55.0 bundles 166 commits from 27 contributors.


✨ New & Improved

Area What’s new
Type Checking - Pyrefly now supports Annotated types and treats them as their base type for most purposes to better conform with the typing specification

- Pyrefly now infers `Self` when constructing a class using `cls()`, also improving typing specification improvements

- Pyrefly can now evaluate `os.name`, similar to existing `sys.platform` support, reducing false positives.

- The `(*args: Any, **kwargs: Any)` syntax is now correctly treated as equivalent to the gradual signature `...`, aligning with Python's typing specification.

- Improved handling when star-unpacking arguments to reduce false positives and improving typing specification conformance
Language Server - Hover results for generic overloads now include type parameters.

- New “Type source” section on hover that reports narrowing and first‑use inference origins
Documentation / Tooling - pyrefly report now measures type completeness and annotation completeness for functions and their parameters.
Performance Improvements - improved performance of concurrent rechecks, reducing latency for LSP requests like hover

🐛 bug fixes

We closed 35 bug issues this release 👏

  • #2406: Fixed an issue where unbound-name errors were incorrectly reported when using NoReturn.
  • #2512: Subclasses of Any are no longer flagged as not callable.
  • #2363: Passing unpacked tuples of types as type arguments to type parameters with a variable number of type arguments now works correctly.
  • #2560: Dynamically computed __all__ is now handled correctly, avoiding false positives.
  • #1197: False positives when calling imported functions that shadow globals or built-ins are now fixed.
  • #2518: The override check for empty tuples has been made more permissive, aligning with other type checkers.
  • #2498: Pyrefly now correctly handles implicit type aliases with the | operator.
  • And more! #2513, #1837, #2532, #2479, #2166, #2546, #2564, #2530, #2499, #417, #714, #832, #1137, #1369, #1708, #1774, #2055, #769, #2588, #2426, #2521, #757, #2537, #2595, #2511, #2528, #958

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

@yangdanny97, @migeed-z, @rchen152, @grievejia, @kinto0, @stroxler, @samwgoldman, @jvansch1, @asukaminato0721, @fangyi-zhou, @arthaud, David Tolnay, @connernilsen, @ndmitchell, @javabster, @rubmary, @Adist319, @rchiodo, @DanielNoord, Ben Carr, @avikchaudhuri, @terror, @disrupted, @MarcoGorelli, @hanzel-sc


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.