Sourced from pyrefly's releases.
Pyrefly v0.57.1
Fixed a bug that could cause Pyrefly to hang.
Pyrefly v0.57.0
Status: Beta
Release date: March 16, 2026Pyrefly 0.57.0 bundles 116 commits from 17 contributors.
✨ New & Improved
Area What’s new Type Checking - Improved type narrowing for hasattrinside loops -pyrefly suppressno 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 - Improvednamedtuplesupport with*field unpacking - Fewer false-positive “variable is not initialized” errorsLanguage 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 NewTypeas unused, even whenNewType(...)was referenced.- #2743: Fixed an issue where
TypedDictfields named items/values prevented access to the correspondingdict.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 aParamSpec, causing a false-positive type error.- #2650: Fixed an issue where a
Protocolparameterized byParamSpec[...]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.0How 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:
... (truncated)
9d24c65
v0.57.10c8881e
Fix infinite loop in variance inference for self-referential generic
classes12e59d0
Reviewed By: rchen152e02d994
Wire up Glean external references for incoming call hierarchy3c5feaf
Add convert_external_references_to_incoming_calls8524405
add "why you should use pyrefly" FAQ753c5a3
Add PysaModuleIndex to replace cross-module ModuleContext::create
calls651f498
Optimise comment parsing372fe49
Remove unused code in the pyrefly_util crate1998c10
Remove unused code in the pyrefly_bundled crate