Skip to content

Releases: facebook/pyrefly

Pyrefly v0.40.0

04 Nov 15:23

Choose a tag to compare

Status : ALPHA
Release date: 03 November 2025

Pyrefly v0.40.0 bundles 143 commits from 26 contributors.


✨ New & Improved

Area What’s new
Language Server - Go-to definition / hover to overloads on operators like ==

- Fold on docstrings

- New LSP configuration arguments added allowing users to enable/disable specific IDE features like Go-to-definition, Autocomplete, and Hover tooltips. See docs here for details.

- Unreachable code will now be grayed out.

- Fixed bug with symlinked paths in VSCode
Type Resolution Implemented a TypeCache to significantly optimize is_subtype queries by caching resolved types. This leads to faster type checks and a more responsive IDE experience.
Error Reporting Introduced a new FindError that will inform a user when there is a stub available for a package that they do not have installed. The default severity level for this will be a warning.
Django Integration Continued work on Django support, including improved type inference for lazy enum labels
Jupyter Notebook support Basic type checking support (pyrefly check path/to/file.ipynb) now available for jupyter notebooks. Still very experimental, further improvements coming soon

🐛 bug fixes

We closed 15 bug issues this release 👏

  • #1414 - Ensured typing_extensions.dataclass_transform works correctly.
  • #1351 - Correctly accept TypedDict as Partial when unpacking one TypedDict into another and detect more open-unpacking errors.
  • #1257 - Addressed a crash related to Var::ZERO during autocomplete by using deep_force to replace unsolved variables with Unknown.
  • #1104 - Resolved an issue where the VSCode extension did not highlight problems in files with symlinked paths under Linux
  • #1045 - Addressed a false-positive in raise..from statements by correctly handling None when it appears in a union
  • And more: #1412, #1409, #1405, #1396, #1356, #1294, #1288, #1234, #1145, #1119

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.40.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, @arthaud, @yangdanny97, @stroxler, @kinto0, @samwgoldman, @connernilsen, @grievejia, @tianhan0, , @rubmary, @nhawkes, @diliop, @migeed-z, @jvansch1, @vladima, @lolpack, @asukaminato0721, @dtolnay, @kv9898, @maggiemoss, @michaelcortese, Anqi Wu, Willy Lau

Pyrefly v0.39.0

28 Oct 14:08

Choose a tag to compare

Status : ALPHA
Release date: 27 October 2025

Pyrefly v0.39.0 bundles 195 commits from 19 contributors


✨ New & Improved

Area What’s new
Inheritance checks - Added additional inheritance checks for typed dictionaries

- Pyrefly no longer throws duplicate errors for overridden fields

- Multiple inheritance checks are now skipped for some special fields, such as constructors
Language Server - Major improvement on startup time for IDE features. This change makes most IDE features available instantly, with completions being available a few seconds later in large environments with hundreds of site-packages

- Pyrefly can now update imports when files are renamed, by handling will_rename_file , a request sent by the language client when files are renamed.

- Add semantic highlighting and hover docstrings in the Pyrefly website sandbox

- Better IDE support for files that don’t have a marker file (pyproject.toml / pyrefly.toml), making operations like find-references should now work in almost every case
Build Systems Improved handling of namespaced directories in build systems. Pyrefly now keeps track of namespaces (directories with a python or source file, but no __init__) in the build system, then returns them for Pyrefly to work with
Docs & error messages - Improved no-matching-overload errors. When no overload matches a function call, Pyrefly now displays the actual argument types that were provided. This eliminates the need to hover over each argument to understand why the call failed.

- New error kind untyped-import added to detect missing Django stubs. This error is ignored by default; see the configuration docs for how to enable it.

- Improved Pydantic documentation to explicitly list supported features.

🐛 bug fixes

We closed 10 bug issues this release 👏

  • #1364 - __bool__ check not working properly with unions
  • #1322 - autocomplete for StrEnum imports not working properly
  • #1337 - unbound-name errors erroneously thrown in try, except blocks
  • #1345 - IDE startup time very slow when site-packages directory contains a large number of additional packages
  • And more! #1374, #1359, #1320, #1302, #1257, #1217

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

@yangdanny97, @stroxler, @connernilsen, @kinto0, @migeed-z, @arthaud, @rchen152, @tianhan0, @samwgoldman, @lolpack, @Adist319, @asukaminato0721, @fangyi-zhou, @immanuel-peter, @jvansch1, @javabster, @pawelstrzmeta, @rubmary,

Pyrefly v0.38.0

21 Oct 14:56

Choose a tag to compare

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.
- Renaming files will now update imports that reference those files.
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!

Pyrefly v0.37.0

14 Oct 13:59

Choose a tag to compare

Pyrefly 0.37.0

Status : ALPHA

Release date: 2025-10-14

Pyrefly 0.37.0 bundles 198 commits from 15 contributors. This release brings major improvements to typechecking control flow, overload resolution, Django/enum support, and more.


✨ New & Improved

Area What’s new
Control Flow & Type Narrowing Improve type narrowing across if/else, match, boolean ops, and loops. This enables more precise type inference and fixes several long-standing false positives and negatives.
Overload Resolution Fully implemented the Python typing spec for overload call evaluation, including argument type expansion for unions, bools, enums, tuples, and type. Overloads are now filtered by argument count and variadic-ness, with better error messages and performance.
Django & Enum Support Enhanced Django model field type inference, improved enum attribute handling (including Django enums), and fixed bugs with auto(), Choices, and mixed-in enum data types.
LSP & Editor Features Added inlay hints for function argument names, docstrings for attribute and variable completions, and improved workspace folder detection for LSP clients.

🐛 Bug Fixes

We closed 12 bug issues this release 👏

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.37.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, @yangdanny97, @arthaud, @connernilsen, @rchen152, @migeed-z, @grievejia, @fangyi-zhou, @kinto0, @fatelei, @ndmitchell, @brosenfeld, @dtolnay, @john Van Schultz


Thank you to everyone who contributed code, bug reports, and feedback!


Full changelog: Comparing 0.36.0...0.37.0

Pyrefly v0.36.0

06 Oct 22:23

Choose a tag to compare

Pyrefly v0.36.0

Status : ALPHA

Release date: 2025-10-06

Pyrefly v0.36.0 bundles 150 commits from 23 contributors. This release brings major improvements to performance, type checking, and Pydantic/Django support, along with numerous bug fixes and a brand new baseline feature.


✨ New & Improved

Area What’s new
Performance With #360 solved, Pyrefly is much faster on projects & environments with a large number of dependencies.
Baseline Feature A new experimental baseline mechanism to store existing errors in a separate file. See the docs for more info.
Control Flow & Type Narrowing Major improvements to how we model control flow and type narrowing, reducing false-positive errors. Builtin types can now be narrowed to literals in more situations.
LiteralString Added support for LiteralString in format(), join(), and replace() methods.
Pydantic Enhancements and bug fixes were made to the experimental Pydantic support released last month. Pydantic's docs now contains documentation for how to use Pyrefly with Pydantic!
Django Progress on experimental support for Django fields and enums.
IDE Bug fixes for auto-import quick fix, improved hover info format to improve readability, reduce clutter, and enable syntax highlighting for function types.
Sandbox Browser sandbox now supports Python stub files (.pyi).

🐛 Bug Fixes

We closed 20 bug issues this release 👏

#264,#360,#528,#657,#683,#778,#790,#812,#969,#1009,#1022,#1042,#1088,#1162,#1198,#1210,#1218,#1227,#1228,#1235

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.36.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, @arthaud, @samwgoldman, @connernilsen, @migeed-z, @rchen152, @grievejia, @ndmitchell, @yangdanny97, @AryanBagade, @rubmary, @cjlongoria, @simonhollis, @MarcoGorelli, @mohesham88, @Viicos, @Adist319, @airvzxf, @brianrosenfeld, @ivanloskutov, @ahornby, @kinto0


Skip to content


If you need more details on any change, see the full commit log.

Pyrefly v0.35.0

30 Sep 14:13

Choose a tag to compare

Status : ALPHA
Release date: 29 September 2025

Pyrefly v0.35.0 bundles 226 commits from 18 contributors.


✨ New & Improved

Area What’s new
Configuration - Improved config finding, preferring Pyrefly configurations in any parent directory to project root marker files. pyproject.toml files are now only considered configurations when a [tool.pyrefly] section is present, otherwise, they are root marker files.
Build systems - Continued work on build system support, primarily Buck. Look out for further updates coming soon!
Error messages and suppressions - Improved reveal_type/assert_type error messages to suggest importing from typing when needed, rather than a generic “could not find name” error message

- New error kind introduced: inconsistent-overload. This gives overload consistency errors a separate error kind from other invalid overload errors so that users can turn off consistency checks if they wish. suppress-error command now has optional --same-line argument for easier bulk suppression of errors. Instead of adding pyrefly ignore comments on the line above, this flag adds the comment on the same line as where the error is.
Security - upgraded mdbook crate to 0.4.52 to resolve vulnerability with ammonia dependency
Third party package support - Improved handling of optional Pydantic fields (if they are optional we should not require them)

- Foundational work to support Django enums

🐛 bug fixes

We closed 11 bug issues this release 👏

  • #1167, #1166 - inaccuracies with type(x) returning the wrong thing
  • #954 - fixed an issue with Pyrefly not recognising Session context manager from SQL Alchemy. Fixing this issue brings us one step closer to Pyrefly being full usable SQL Alchemy (follow progress here)
  • #260 - unions of dunder methods weren’t being recognised correctly
  • And more - #1165, #1148, #1146, #1030, #614, #527, #300

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.35.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, @samwgoldman, @grievejia, @kinto0, @rchen152 , @yangdanny97, @tianhan0, @stroxler, @SamChou19815, Carlos Fernandez, @cjlongoria, @connernilsen, @maggiemoss, @arthaud, @mohesham88, @VladimirMakaev, @migeed-z

Pyrefly v0.34.0

23 Sep 14:21

Choose a tag to compare

Status : ALPHA
Release date: 22 September 2025

Pyrefly v0.34.0 bundles 180 commits from 22 contributors.


✨ New & Improved

Area What’s new
Type Parameter Handling - Significant refactoring of internal logic for handling uninitialised variables, resolving multiple bugs in the process

- Support added for referring to imported legacy TypeVars by their fully qualified name (see example in sandbox)

- Support added for implementing protocols with generic methods.
IDE - IDE logic has been refactored to limit concurrent recheck and find-references tasks, preventing excessive thread spawning under heavy workload and improving overall IDE responsiveness.

- IDE autocomplete now displays if a method or function is deprecated�

-IDE autocomplete now escapes single quotes (’’) for autocomplete
Pyrefly Configs - Users can now use negation when setting replace-imports-with-any . Eg. replace-imports-with-any: ["!sympy.printer", "sympy.*"] will replace any sympy imports with Any EXCEPT for sympy printer imports
Error Messaging
- Improved how overload signatures in error messages are displayed to avoid printing confusing upper bounds of TypeVars
Documentation
- IDE documentation updated to include Jupyter Lab information and improved inlay hint instructions.

🐛 bug fixes

We closed 21 bug issues this release 👏

  • #1058 - abstractmethod decorated functions issue caused literal types in signatures to be promoted incorrectly
  • Addressed issue that caused false positives when using the jaxtyping library: #925
  • Addressed multiple issues relating to TypeVars: #1050, #912, #129
  • Addressed multiple issues with IDE autocomplete: #1095, #986, #798
  • #200 - pyrefly --watch CLI command now works again!
  • Other issues: #1073, #947, #936, #829, #825, #724, #698, #680, #604, #429, #340, #114, #111

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.34.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, @tianhan0, @ndmitchell, @yangdanny97, @stroxler, @arthaud, @SamChou19815, @grievejia, @javabster, @connernilsen, @cooperlees , @dluo, @dtolnay, @fangyi-zhou, @kinto0, @maggiemoss, Paul Iatchenii, @samwgoldman, @sandeshbhusal, @VladimirMakaev, @migeed-z

Pyrefly v0.33.0

16 Sep 13:59

Choose a tag to compare

Status : ALPHA
Release date: 15 September 2025

Pyrefly v0.33.0 bundles 117 commits from 21 contributors


✨ New & Improved

Area What’s new
Type Checker Behavior - Pyrefly now distinguishes between Any as a value and as a type, preventing incorrect attribute access and constructor calls on Any values. For example, when Any (the value) is used as an attribute base or call target pyrefly will now error if you try to access attributes that are not defined on type.
- Basic support added for TypeAliasType
Experimental support for Pydantic now available!
- Type error messages by default now print paths relative to working directory (as opposed to absolute path)
IDE improvements - Kwarg completion now supports literals and unions of literals (requested feature)
- A new "typeServer/getSupportedProtocol" request handler included to fetch TSP version information
Website and Documentation - The sandbox feature on the website has been upgraded! It can now deal with multiple files, allowing users to try out Pyrefly with cross-file imports. Give it a go here!
- New documentation guide on experimental Pydantic support, read it here
- New editable installs section in documentation, detailing the nuances of working with editable dependencies. Read it here.

🐛 Bug fixes

We closed 4 bug issues this release 👏

  • #1052 - regression that caused issue with return type list[Self]
  • #1034 - Python version dropdown in website sandbox not working properly
  • #817 - bad-override error split into 2 separate error codes for type and name differences in arguments
  • #573 - when a package is pip-installed as editable from a local directory as a dependency, it was added in a way that Pyrefly didn’t recognise

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.33.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, @stroxler, @grievejia, @ndmitchell, @fangyi-zhou, @samwgoldman, @rchen152, @kinto0, @connernilsen, @AryanBagade, Brian Rosenfeld, Carlos Fernandez, @yangdanny97, @hashiranhar, @IDrokin117, @maggiemoss, @rchiodo, @VladimirMakaev, @migeed-z

Pyrefly v0.32.0

09 Sep 13:31

Choose a tag to compare

Status : ALPHA
Release date: 08 September 2025

Pyrefly v0.32.0 bundles 70 commits from 18 contributors


🚨Major Change for IDE extension

With this release type errors are now disabled by default in IDE when there is no config present ( in pyrefly.toml or pyproject.toml). This change was made based on feedback that displaying type errors by default in the IDE (i.e. red squiggles) was a nuisance for new users, especially those looking only for language services. Users are still able to enable type checking without a configuration file if they wish by updating their config (either in their pyproject.toml, pyrefly.toml or VSCode settings):

# to enable type errors
"python.pyrefly.displayTypeErrors": "force-on"

✨ New & Improved

Area What’s new
Type Checker Behavior - Implicit return validation is now performed even when untyped-def-behavior is set to check-and-infer-return-any for functions with explicit return annotations. This fixes a conflation issue where return type inference being disabled also disabled implicit return validation.

- Improved handling of calls on type[...] including cls (typed as type[Self]).

- Deprecation warnings are now emitted when a deprecated function is referred to, not just called. Scoping for class fields in nested scopes is now correctly handled.
IDE Integration - Type errors now disabled by default in IDE (see details above).

- Users can now see in their IDE status bar whether the current file has type errors enabled/disabled

- Improved hover for Union types, so hover display now merges identical elements.
Build Systems & Security - Further improvements made to emulate Buck’s build system file mappings within Pyrefly. This improves Pyrefly's integration with various build systems in OSS and IDEs, though build system support is still in progress.

- The tracing-subscriber crate was updated from 0.3.19 to 0.3.20 to fix RUSTSEC-2025-0055, addressing a vulnerability related to ANSI escape sequence injection attacks in logs.

🐛 Other bug fixes

We’ve closed 10 bug issues since our last minor release 👏

  • #1036 - class property on enums incorrectly typed as Literal
  • #1016 - pyrefly process not terminating and consuming significant CPU and memory
  • #977 - issue handling attributes in dataclasses
  • panics resolved: #509, #962
  • Other bugs fixed: #980, #647, #264

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.32.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, @dtolnay, @kinto0, @samwgoldman, @SamChou19815, @grievejia, @migeed-z, @yangdanny97, @arthaud, @tianhan0, @AryanBagade, @asukaminato0721, Carlos Fernandez, @connernilsen , @fangyi-zhou , @hashiranhar, @VladimirMakaev

Pyrefly v0.31.0

03 Sep 15:52

Choose a tag to compare

Status : ALPHA
Release date: 02 September 2025

Pyrefly v0.31.0 bundles 69 commits from 19 contributors


✨ New & Improved

Area What’s new
PEP 728 support - extra_items is now fully supported, with these changes support for PEP 728 is now complete! 🚀
LSP Features - Introduced Pylance config python.analysis.importFormat, with possible values ”absolute” and ”relative”.

- The default "absolute" maintains the current behavior, while "relative" enables importing modules using relative paths server name and version string now returned during LSP initialisation, useful for LSP clients for debugging/logging.
Type Narrowing - Improved narrowing for getattr(...) Narrow hasattr with string literals to Any if the attribute does not already exist
Inference & autocomplete - Improved inference for self annotation: inferred to be type[Self] when decorated with classproperty or lazy_classproperty.

- Improved autocomplete for imports with addition of import keywords. (Previously from x imp… would autocomplete to from x import imp)
Build System Integration - Standalone pre-commit hook now available, see updated docs here

- Refactored Buck build functionality into a new pyrefly_build crate. This does not involve functional changes but lays the groundwork for future work to enable Pyrefly to work more effectively with various build systems in both OSS and IDE environments.
Conformance - Pyrefly has now been added to the conformance test suite, enabling users to compare behaviour of static type checkers against expectations defined in the Python typing specification

🐛 Bug fixes

We closed 12 bug issues this release 👏

  • A few issues with decorators:
    • #951 - pyrefly unable to find matching overloads for decorators with arguments
    • #809 - failure to apply self
    • #625
  • #921- incorrect type signature labelled for type[T].__new__
  • #509 - panic on __all__ mutation without definition
  • #322 - error thrown falsely on unittest.main()
  • #71 - issue iterating over enums
  • Other bugs: #932, #926, #765, #245, #162

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

@lolpack, @aahanaggarwal, @donsbot, @kinto0, @stroxler, @rchen152, @grievejia, @brosenfeld, @yangdanny97, @SamChou19815, @migeed-z, @connernilsen, @tianhan0, @javabster, @PIG208, @samwgoldman, @IDrokin117, @maggiemoss, @arthaud , @melvinhe, @rchiodo, @VladimirMakaev