Skip to content

Releases: facebook/pyrefly

Pyrefly v0.53.0

18 Feb 21:15

Choose a tag to compare

Pyrefly 0.53.0

Status : BETA
Release date: 17 February 2026

pyrefly 0.53.0 bundles 245 commits from 27 contributors.


✨ New & Improved

Area What’s new
Type Checking - Recursive type aliases now supported, so you can define type aliases that reference themselves, and Pyrefly will correctly resolve and type-check them

- Error is now raised when Self is used in certain invalid locations (outside a class, in a static method within a class, in a metaclass)

- Pyrefly now supports the idiom class Foo(namedtuple("Bar", ...)), matching CPython and Mypy behavior

- Pyrefly will now warn you if a protocol’s type variable is used in a way that doesn’t match its declared variance
Language Server - Completion suggestions are now ranked based on most recently used (MRU) items

- Auto-import completions and unknown-name quick fixes now honor common aliases (e.g. import numpy as np)

- Improved error messages for signature mismatches, including ASCII-style diffs and normalized function names for clarity
Config - JSON schemas added for pyrefly.toml and pyproject.toml to enable editor features like auto-completion and validation
Performance - Pyrefly uses ~26% less CPU when tested typechecking the whole Pytorch codebase on M1 Pro MacBook with 10 cores

🐛 bug fixes

We closed 17 bug issues this release 👏

  • #949 - Lambdas with yield or yield from are now correctly inferred as generator-returning callables.
  • #2407 - Literal imported via try/except is now recognized as a special form, preventing spurious unknown-name errors
  • #2375 - Methods overriding base class methods no longer trigger false positive errors for missing @override decorators.
  • #2327 - The first parameter of class methods is now correctly handled regardless of its name.
  • And more - #1754, #1383, #1790, #2350, #2369, #2371, #2392, #2335, #259, #254, #1778, #2116, #2302

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.53.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](https://pyrefly.org/en/docs/error-suppressions/)

🖊️ Contributors this release

@stroxler, @rchen152, @yangdanny97, @asukaminato0721, @samwgoldman, @kinto0, @connernilsen, @grievejia, @fangyi-zhou, @migeed-z, @ndmitchell, @jackulau, @jvansch1, @rubmary, @alanhdu, @avikchaudhuri, @arthaud, @DanielNoord, @diliop, @ipr-ams, @javabster, @oopscompiled, @Prathamesh-tech-eng, @self-sasi, @dtolnay, Vladimir Matveev, Robert Rusch

Pyrefly v0.52.0 (speed skate ⛸️)

10 Feb 16:21

Choose a tag to compare

Status : BETA
Release date: 09 February 2026

Pyrefly v0.52.0 bundles 250 commits from 23 contributors.


📈 Performance Improvements

As we’ve been watching Winter Olympic athletes racing for gold, we’ve been inspired by their dedication to keep pushing our own bobsled towards our goals of making Pyrefly as performant as possible. Just as milliseconds count in speed skating, they also matter when it comes to type checking diagnostics! With this release, Pyrefly users can benefit from a range of speed and memory improvements, which we’ve summarised below. But this is just the first lap, the race isn’t over! We’re committed to ongoing performance improvements and adding robust testing to prevent regressions, so stay tuned for more performance updates coming soon.

18x Faster Updated Diagnostics After Saving a File

We’ve significantly improved the speed at which type errors and diagnostics appear in your editor after saving a file. Thanks to fine-grained dependency tracking and streaming diagnostics, Pyrefly now updates error messages almost instantly,even in large codebases. In edge cases that previously took several seconds, updates now typically complete in under 200ms. For a deep dive into how we achieved this, check out our latest blog post.

2–3x Faster Initial Indexing Time

The initial indexing process (i.e. when Pyrefly scans your project and builds its internal type map) has been optimized for speed. This means you can start working with type-aware features much sooner, even in massive repositories.

40–60% Less Memory Usage

We’ve made significant improvements to Pyrefly’s memory efficiency. The language server now uses 40–60% less RAM during both initial indexing and incremental type checking. This allows Pyrefly to scale to larger projects and run more smoothly on resource-constrained machines.

Edge case exponential memory blow up contained

A critical bug that caused exponential memory usage when handling unions of dictionary types has been resolved. This fix ensures that Pyrefly remains stable and performant, even when working with complex type structures.


✨ New & Improved

Area What’s new
Type System Added support for template strings (PEP 750) Type narrowing enhancements: dict.get narrowing and safer negative narrowing
Language Server Users can now automatically transform from ... import * statements into explicit imports for names used in the file Improved auto-complete for match Literal patterns Further support for type hierarchy now available in IDE Go-to definition on __all__ entries now brings you to the definition See all of the new features in more detail in our updated IDE supported features page

🐛 bug fixes

We closed 13 bug issues this week 👏

  • #713 - Fixed unsound narrowing for isinstance and type[T]
  • #289 - Expanded key-existence narrowing to dict-like types so "key" in mapping now makes mapping.get("key") return the value type (not None).
  • #2248 - Fixed augmented assignment (+=) when __iadd__ is missing to correctly fall back to __add__ and ignore __getattr__, aligning with Python runtime semantics.
  • 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.52.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

@ndmitchell, @rchen152, @stroxler, @kinto0, @asukaminato0721, @yangdanny97, @grievejia, @migeed-z, @jvansch1, @samwgoldman, @avikchaudhuri, @maggiemoss, @arthaud, @AryanBagade, @connernilsen, @diliop, @fangyi-zhou, @javabster, @robertoaloi, @tianhan0, @dtolnay, Carlos Fernandez, Miles Conn


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

03 Feb 15:33

Choose a tag to compare

Status : BETA
Release date: 02 February 2026

Pyrefly v0.51.0 bundles 162 commits from 25 contributors.


✨ New & Improved

Area What’s new
Type Checking - Fixes for incorrect type narrowing in boolean operations with generic functions

- Intersection logic fixed to identify empty intersections (Never) for final classes and populated Enums, as they cannot be subclassed.

- Added support GenericAlias type, including special attributes like __origin__, __args__, and support for the pipe operator

- Added support for checking that class-scoped type variables are not used in self annotations in __init__ methods, per typing spec
Language server - During module resolution, "phantom paths" (non-existent paths checked during import) are now tracked, improving watch mode and import re-resolution

- List addition (+) now propagates type hints to both operands, making assignments like l2: list[Base] = [A()] + [B()] work as expected
Error Handling - Added configuration to debug and/or bypass deep recursion, which is useful for diagnosing stack overflow issues in large or generated codebases

- Multiple error messages have been shortened, clarified, or made more precise for better user experience (e.g., TypedDict, protocol variables, unpacking errors, pydantic, descriptor defaults).
Performance Improvements - Faster suggested standard library imports (did you mean...?)

- Reduced memory usage for type aliases of unions

- Further improvements to tracking for fine-grained dependencies, improving IDE performance during incremental rechecks and accuracy of features like auto-imports

🐛 bug fixes

We closed 21 bug issues this release 👏

  • #2269 - Attribute lookups on classes inheriting from Any now fall back to Any instead of reporting missing-attribute.
  • #2250 - Self is now properly bound in class body expressions.
  • #2236 - fixed issue where --removed-unused-ignores incorrectly removed ignores from other type checkers
  • #2196 - Tuple length checks with isinstance now work correctly with unpacked tuples and type variables
  • #2118 - Legacy TypeVars are now correctly inferred in Callable annotations without assignment
  • And more! #990, #842, #496, #2036, #1917, #1807, #1714, #1680, #2169, #2141, #2211, #2208, #2246, #2267, #2256, #2274

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

@rchen152, @stroxler, @migeed-z, @kinto0, @yangdanny97, @arthaud, @maggiemoss, @connernilsen, @grievejia, @samwgoldman, @rubmary, @fangyi-zhou, @AryanBagade, @bluetech, @ddrcoder, @javabster, @ndmitchell, @praskr-wisdom, @shayne-fletcher, @tsembp, @jvansch1, @tianhan0, @dtolnay

Pyrefly v0.50.0

28 Jan 15:42

Choose a tag to compare

Status : BETA
Release date: 26 January 2026

Pyrefly v0.50.0 bundles 183 commits from 27 contributors.


✨ New & Improved

Area What’s new
Language Server - Hovering or requesting signature help for constructor calls now shows the instance type instead of -> None

- Structured comment headers (e.g., # Title ----) now create hierarchical folding regions and outline symbols in editors. This can be enabled with the commentFoldingRanges setting that is now available in VSCode’s settings UI

- Go-to-definition now works for intermediate submodule components (e.g., clicking on b or c in a.b.c.D), improving navigation in complex module hierarchies

- Inlay hints now available for variables created from tuple unpacking (e.g. x, y = (a, b))

- Type variable bounds, constraints, and defaults are now shown when formatting generic types.

- Previously, reveal_type showed identical signatures for functions with different type variable restrictions
Type Checking Type narrowing now works for TypedDict when using in/not in checks, including inherited keys and empty TypedDicts
File Structure/Detection Better support for detecting and renaming editable installed packages
Error Reporting The suppress command now accepts JSON values, making error suppression more flexible and scriptable.

🐛 bug fixes

We closed 30 bug issues this week 👏

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

@rchen152, @kinto0, @grievejia, @stroxler, @migeed-z, @yangdanny97, @connernilsen, @asukaminato0721, @maggiemoss, @rubmary, @samwgoldman, @Adist319, @arthaud, @AryanBagade, @jackulau, @self-sasi, @sgavriil01, @kv9898, @maifeeulasad, @maldoinc, @pawelstrzmeta, @robertoaloi, @jvansch1, @tianhan0, @dtolnay, Vladimir Matveev

Pyrefly v0.49.0

21 Jan 14:06

Choose a tag to compare

Status : BETA
Release date: 20 January 2026

Pyrefly v0.49.0 bundles 231 commits from 25 contributors.


✨ New & Improved

Area What’s new
Type Inference - Partial type inference now possible in loops

- Variance inference for self-referential generic types (PEP 695)

- typing.Mapping now recognised as a type alias
Language Server - Improved refactoring capabilities for moving module members and lifting local functions/methods to top-level module scope, with automatic import/shim creation.

- Hover support for in keyword when used in iteration contexts (for-loops and comprehensions), showing the type of the iterable being iterated over

- “Go to symbol” now correctly includes methods inside a class

- Enabled clickable inlay hints for built-in types like tuple, dict, str, and special forms (TypeVar, ParamSpec, etc.), allowing users to quickly navigate to type definitions in the IDE
Pydantic Support Added detection and support for pydantic.dataclasses.dataclass decorator, including strict and lax mode support for pydantic dataclasses
Error Reporting Improved error messages for yield, yield from, augmented assignment, missing imports, and missing stubs for better user clarity.

🐛 bug fixes

We closed 38 bug issues this week 👏

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.49.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, @Adist319, @asukaminato0721, @connernilsen, @yangdanny97, @diliop, @fangyi-zhou, Jack, @grievejia, @jvansch1, @Karman-singh15, @kinto0, @arthaud, @ndmitchell, @rchen152, @samwgoldman, @Sehat1137, @stroxler, @tianhan0, @tannguyencse19, @migeed-z

Pyrefly v0.47.0

06 Jan 16:38

Choose a tag to compare

Status : BETA
Release date: 05 January 2026

Pyrefly v0.47.0 bundles 207 commits from 35 contributors.


✨ New & Improved

Area What’s new
LSP Features - Improved autocompletion for keys in .get() on TypedDicts

- Improved documentation in hover tooltips for attributes like dataclass fields

- Improved import handling: import X as X and from Y import X as X are now recognized as explicit re-exports and not flagged as unused imports.
Type Checking - TypeIs calls now correctly narrow to the intersection of types instead of Never.

-Final attributes that are not initialized on the class are now enforced as such. Previously, Final was only enforced if the attribute was initialized on the class.

- Improved typing spec conformance by extending reassignment checks for variables declared as Final to additional binding constructs including unpacking, context managers, and loops.
Pydantic Support - Support added for Annotated fields

- Pyrefly now validates BaseModel fields at instantiation, catching out-of-range arguments (e.g., Model(x=0) when x must be gt=0).
Error Types / Diagnostics - New error codes non-exhaustive-match warns about incomplete match statements over Enums and unions of literals.

- New missing-override-decorator error that is emitted when a method overrides a parent class method but does not have the override decorator. This error is off by default and can be enabled in your .toml configuration

- Pyrefly now suggests the closest stdlib module name for mistyped imports (e.g., import jsnDid you mean 'json'?).

🐛 bug fixes

We closed 34 bug issues this release 👏

  • #1952 - Allow typing_extensions for typing module special callables.
  • #1906 - The single-underscore function _ is now correctly exported from custom builtins for i18n support.
  • #1905 - Fixed stack overflow panic in protocol conformance check involving recursive Forall types and method lookups.
  • #1784 - Fixed subtype checking for LiteralString and Collection.
  • #1723 - Ignore textDocument/didClose for notebooks and vice versa in the LSP server.
  • #1597 - Type narrowing now uses intersection logic, preventing overly strict type errors.
  • #1375 - Improved support for object.__new__(C) which was previously incorrectly inferring the type as object.
  • #1086 - Autocomplete for string Literal values no longer inserts redundant quotes when completing inside a string literal.
  • And more: #1048, #880, #844, #821, #792, #504, #1274, #1271, #1213, #1209, #1091, #1393, #1659, #1657, #1603, #1783, #1758, #1903, #1880, #1856, #1791, #1948, #1910, #1962, #1961

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

@aleivag, @ArchieBinnie, @AryanBagade, @asukaminato0721, Bharath Sundararaj, Brian Chien, Cédric Barreteau, @connernilsen, @yangdanny97, @dtolnay, @fangyi-zhou, @gvozdvmozgu, @jackulau, @grievejia, @jvansch1, @Karman-singh15, @kinto0, @martindemello, @arthaud, @nikita-ashihmin, @nitinsingh-meta, @rchen152, @kitagry, @salmanmkc, @samwgoldman, @ska-kialo, @stroxler, Tatiana Ber, @tannguyencse19, @zanieb, @migeed-z

Pyrefly v0.46.0

16 Dec 10:53

Choose a tag to compare

Status : BETA
Release date: December 15, 2025

Pyrefly v0.46.0 bundles 125 commits from 19 contributors.


✨ New & Improved

Area What’s new
Language Server - Call Hierarchy support for the Pyrefly LSP server now implemented. This is a fundamental IDE feature that allows users to explore function call relationships in your IDE.

- Function documentation now available in signature help

- Signature help now uses single-line labels, thereby maintaining compatibility with editors that don't support multi-line labels while still keeping hover tooltips readable

- Variables defined in ALL_CAPS are now correctly highlighted as constants in VSCode and the website sandbox.
Type Checking Implemented PEP 765 warnings. The checker now warns if return, break, or continue statements directly exit a finally block. Starting in Python 3.14, these statements emit a SyntaxWarning because they can silently mask exceptions.
Third Party Library Support - Added third-party stubs for scipy, matplotlib, scikit-learn, scikit-image, vispy, sympy, pandas, conan, botocore, and boto3 to the Pyrefly bundle for better out-of-the-box support for these libraries.

- Support for Pydantic “lax mode”. Pyrefly can now model Pydantic’s lax runtime behavior more precisely. As a result, you may see new inferred types such as LaxInt and LaxBool in your IDE, representing the unions of input types that Pydantic accepts at runtime.
Errors / Debugging Debug symbols are now included in release builds, enabling users to generate usable stack traces in crash reports

🐛 bug fixes

We closed 14 bug issues this release 👏

  • #1826 - Fixed panic/crash caused by capacity overflow with large tuple expansion.
  • #1809 - Fixed __future__ imports being incorrectly flagged as unused, as they have necessary module-level side effects.
  • #1794 - Fixed a panic/crash when a text range calculation exceeded the document buffer size limit.
  • #1418 - Fixed function hover popups (especially in numpy) missing the function name in the header when resolving from stub files.
  • #1289 -Fixed special casing for numba jit decorators (corrected path handling).
  • And more: #1348, #1214, #820, #253, #1667, #1787, #1799, #1821, #1709

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==v0.46.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

@javabster, @AryanBagade, @asukaminato0721, @connernilsen, @DanielNoord, @yangdanny97, @dearfl, @fangyi-zhou, Jack, @jvansch1, @kinto0, Liam, @arthaud, @rchen152, @samwgoldman, @stroxler, @tianhan0, @migeed-z

Pyrefly v0.45.0

09 Dec 12:52

Choose a tag to compare

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

Pyrefly v0.44.0

03 Dec 23:48

Choose a tag to compare

Status : BETA
Release date: 03 December 2025

Pyrefly v0.44.0 bundles 163 commits from 23 contributors.


✨ New & Improved

Area What’s new
LSP / IDE - Inlay hints are now clickable, allowing Go-To-Definition for class and type names (e.g., List or T) directly from the hint overlay.

- Completions are now disabled inside comments and string literals to reduce noise and improve user experience.
Type checking - Recursive type solving logic was significantly refactored, enabling more reliable type inference and bug fixes around self-referential types.

- Bundled typeshed and third-party stubs have been updated, improving compatibility and type checking for more libraries
Pydantic/Dataclass - Added support for Pydantic range constraints (e.g., pydantic.types.PositiveInt).

- New infrastructure introduced to better support Pydantic lax mode

- Support added for the Decimal type.
Error Handling Error suppressions are now stricter, only applying when the suppression comment is on the start line, reducing false negatives

🐛 bug fixes

We closed 11 bug issues this release 👏

  • #1692 - fixed an issue where args and kwargs of wrapper functions were wrongly reported as not subscriptable
  • #1665 - Prevents unnecessary Literal[...] tooltips when hovering over docstrings.
  • #1559 - Updated dependencies to pull in fix for ruff parser that was causing Pyrefly to crash in jupyter notebooks
  • #1372 - resolved issue with inherited properties incorrectly being overridden by assignment
  • And more: #1371, #1035, #1675, #1701, #1688, #1710, #1719

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==v0.44.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](https://pyrefly.org/en/docs/error-suppressions/)

🖊️ Contributors this release

@arthaud, @asukaminato0721 , @connernilsen , @diliop , @fangyi-zhou , @grievejia , @gvozdvmozgu, @Imran-S-heikh, @javabster , @kinto0 , @kshitijgetsac, @migeed-z, @ndmitchell, @ogios, @rchen152, @simonhollis, @stroxler, @yangdanny97, Carlos Fernandez, @dtolnay, @jvansch1, @tianhan0

Pyrefly v0.43.0

25 Nov 14:44

Choose a tag to compare

Status : BETA
Release date: 24 November 2025

Pyrefly v0.43.0 bundles 213 commits from 24 contributors.

✨ New & Improved

Area What’s new
IDE/LSP Features - New warnings for unused imports and unused variables

- Pyrefly LSP features now apply to Python documents with the inmemory schema, improving support for interactive consoles and temporary code cells in IDEs like Positron.

- Added a configuration option to control whether "Go to definition" links appear in hover tooltips, enabled by default
Type Checker Improved support for unpacking tuple[*Ts], fixing cases where unpacking would previously degrade to object If a TypeVarTuple-annotated varargs is unmatched, it now resolves to an empty tuple in all cases
Error Messages - New --enabled-ignores command line flag and configuration option allow specifying exactly which tools’ ignore comments (e.g., # pyright: ignore) pyrefly respects

- CLI flags like --error, --warn, etc., now accept comma-separated lists, making it easier to enable or disable multiple error codes at once.
Pydantic Support Improved handling of RootModel types, including nested and union scenarios. Basic support for Pydantic BaseSettings. Fields in BaseSettings are now treated as optional by default.

🐛 bug fixes

We closed 17 bug issues this week 👏

  • #1642 - TypedDicts with any required keys are now correctly treated as always truthy, allowing for proper type narrowing in boolean expressions
  • #1611- correctly detects await in nested generator expressions, preventing them from being incorrectly typed as Generator instead of AsyncGenerator.
  • #1609 - fixed a bug where positional argument inlay hints for callables with *args would show incorrect positions or duplicates
  • #1598 - Literal strings now correctly participate in protocol subset checks (e.g., against typing.Container), fixing an issue with type signature mismatch
  • #1462 - Allow referencing inherited attributes from a class body's top level.
  • #1256 - fixes crash when the walrus operator (:=) appears in annotation positions
  • #273 - correctly handles tuple[()] | tuple[int, *tuple[int, ...]] to simplify to tuple[int, ...].
  • And more: #1644, #1635, #1633, #1631, #1625, #1604, #1268, #1230, #1016, #981

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.43.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](https://pyrefly.org/en/docs/error-suppressions/)

🖊️ Contributors this release

@javabster, @AryanBagade, @asukaminato0721, @austin3dickey, @yangdanny97, Dhruv Mongia, @fangyi-zhou, @Imran-S-heikh, @grievejia, @jvansch1, @keito, @kshitijgetsac, @kinto0, @arthaud, @nathan-liyiming, @rchen152, Ron Mordechai, @samwgoldman, @cybardev, @stroxler, @tianhan0, @vinnymeller, @migeed-z