Release date: May 27, 2026
About dev releases
Dev releases (versions likeX.Y.Z-dev.N) are non-stable snapshots cut periodically from trunk. They give early adopters a chance to try in-progress features and surface issues before the next stable release, but they don't carry the same stability or compatibility guarantees as a stable release — don't pin production projects to a dev version.
Pyrefly v1.1.0-dev.1 bundles 250 commits from 40 contributors.
✨ New & Improved
Type Checking
- New
incompatible-comparisondiagnostic catches comparisons likeint == strwhere operand types can't overlap. - Classes whose metaclass extends
ABCMetaare now correctly treated as abstract. - Frozen dataclasses reject manual
__setattr__/__delattr__overrides. - Annotation-only descriptor fields are recognized as descriptors — fixes false positives for SQLAlchemy
Mappedand similar asymmetric descriptor types.
Language Server
- Code actions can convert dict literals to TypedDict, dataclass, or Pydantic model — with automatic imports.
- Sphinx cross-references (
:meth:,:class:,:func:) in docstrings now render as clickable links in hover tooltips. - Inlay hints for class attributes defined in
__init__without explicit annotations. - Supports
python.analysis.diagnosticMode,python.analysis.importFormat, andpython.analysis.inlayHintssettings — full interop with the Python VS Code ecosystem.
Error Reporting
- New
explicit-anyerror kind (ignored by default) warns whenAnyappears in annotations or type alias bodies; includes migration support for mypy/pyright codebases. - Diagnostic paths in
baseline.jsonare now relative and always use forward slashes — fixes baseline matching when CI checkout paths differ from local dev environments and across OSes. - The
annotation-mismatcherror kind has been removed (it was never emitted).
Configuration
- New
allpreset enables every error kind at error severity — for codebases that want comprehensive checking. Available in both the CLI and the VS Codepython.pyrefly.typeCheckingModesetting. - New
pytorch-efficiency-lintsflag turns on PyTorch efficiency checks at warn severity: catches.item()GPU sync, redundant.to(device), deprecated.cuda(), andprint(tensor).
Tensor Shapes
- Tensor shape operations now live in user-space stubs (
torch/_shapes.pyi) via the new@uses_shape_dsldecorator. - DSL compile errors and shape-DSL type errors now emit proper diagnostics with precise source spans instead of panicking.
- Recursive
@shape_dsl_functiondefinitions and invalid call signatures are caught at compile time.
Stubgen
- Stubgen now emits synthesized
__init__for dataclasses, preserving constructor signatures in generated stubs.
Build & CI
- Pyrefly now compiles on stable Rust — no more nightly toolchain dependency. GitHub CI workflows updated to match.
- musllinux wheels are now built for Alpine and other musl-based distros.
- Conformance test sources updated from upstream
python/typing.
🐛 Bug fixes
We closed 34 bug issues this release 👏
- #2798: Fixed false positive
not-iterableerror when iterating over a list stored in a dict that also contains non-iterable values. When a dict was built inside a loop with heterogeneous inner dicts (e.g.,{"start": date, "tasks": []}), Pyrefly incorrectly inferred the inner dict's value type asdateinstead ofdate | list[...], causing spurious errors when accessingval["tasks"]. - #3188: Fixed error suppression for multi-line implicit string concatenations. When a
# pyrefly: ignorecomment appeared above a multi-line implicit string concatenation, only the first error was covered. Pyrefly now reparses the AST to respect ignore comments for the entirety of the construct. - #3385: Fixed false positive
missing-override-decoratorwhen assigning to inherited properties. If a child class assigned to a property (with a setter) defined in a base class, Pyrefly incorrectly flagged it as an implicit override. - #3208: Fixed stubgen missing instance variables defined in
__init__. Classes in generated stubs were missing attributes if those attributes were not explicitly annotated at the class level. Stubgen now emits synthesized__init__for dataclasses, preserving constructor signatures. - #3237: Fixed cross-file references lost when CRLF/LF line endings differ. When files on disk used CRLF but the editor sent LF-normalized content via
textDocument/didOpen, byte offsets diverged, causing exact byte-range comparisons to fail. Pyrefly now uses a line-number fallback to match definitions correctly. - #3378: Fixed exhaustive Enum variants not narrowing the type. When a
FinalEnum variant was checked withis not, the type was not narrowed out of the union, causing false positives in exhaustiveness checks. - #3413: Fixed strict mode insisting on
@overridefor standard dunders. Pyrefly now skipsmissing-override-decoratorfor dunders inherited fromobject, as adding@overrideto__repr__,__eq__, etc., is pure noise. - #3455: Fixed crash when overload residual capture included
PartialQuantifiedvars. The solver now correctly handles partial vars in overload residuals, preventing panics. - #3392: Fixed
Self@[Enum]not being properly narrowed. For an exhaustivematchon an enum type within an instance method, theselfargument wasn't being narrowed as expected. Enum member subtraction now preserves and handlesSelfType, allowing exhaustive enum match self fallbacks to narrow toNever. - #3299: Fixed incorrect type inference after
__setitem__/__getitem__. When a class's__setitem__and__getitem__signatures were asymmetric, Pyrefly incorrectly narrowed the assigned value. Subscript-assignment narrowing is now gated by symmetry checks, preventing false positives with custom container types. - And more! #3446, #3448, #3396, #1492, #2451, #3431, #3210, #3381, #2547, #3147, #3524, #3506, #3519, #3343, #3505, #3369, #3344, #3400, #3394, #3221, #3514, #3520, #3544, #3458
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==1.1.0-dev.1How 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:
pyrefly check --suppress-errors- Run your code formatter of choice
pyrefly check --remove-unused-ignores- 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, @ndmitchell, generatedunixname2066905484085733, @yangdanny97, @kinto0, @jorenham, @asukaminato0721, @migeed-z, @samwgoldman, @lolpack, @grievejia, David Tolnay, @connernilsen, @arthaud, @maggiemoss, @NathanTempest, @f1sherFM, @mfish33, @lordhaa123, Anqi Wu, @javabster, @rexledesma, @MackDing, Brian Rosenfeld, @fylux, @YBJ0000, @arpitjain099, @EpicEric, @NarxPal, Philippe Bidinger, @knQzx, @yeetypete, @GHX5T-SOL, Tejesh Mehta, @fangyi-zhou, @LeSingh1, @P-r-e-m-i-u-m, @Arths17, @sjh9714
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.