Pyrefly v1.1 is here 27% faster, refactoring tools, tensor shapes

ocamoss1 pts0 comments

Pyrefly v1.1 is here! | Pyrefly

Skip to main content

Pyrefly v1.1 is now available 🎉 This is our first minor release since reaching stable v1.0 in May, and it brings improvements across the board: better performance, smarter type checking, and new IDE refactoring tools.

This release bundles over 250 commits from 40 contributors. To get started with the new version you can run:

pip install --upgrade pyrefly==1.1.0

In this post, we'll walk through what's new and what's changed.

Performance​

Pyrefly v1.1 is 27% faster than Pyrefly v1.0 on Astral's ty_benchmark suite.

ProjectPyrefly 1.1Pyrefly 1.0ty 0.0.49mypy 2.1.0Pyright 1.1.410black0.262s0.397s0.175s1.339s2.047sdiscord.py0.380s0.522s0.421s4.607s3.636shomeassistant5.398s6.076s5.027s21.332s27.645sisort0.206s0.379s0.526s1.046s3.525sjinja0.196s0.343s0.156s1.432s1.894spandas1.494s1.672s1.152s18.269s8.826spandas-stubs0.401s0.543s0.208s8.259s3.302sprefect0.560s0.682s0.275s0.997s3.901spytorch2.105s2.524s2.989s36.253s16.664s<br>We modified the benchmark suite to include the newest versions of Pyrefly, ty, mypy, and Pyright. We also added support for parallelizing mypy and Pyright, to make them more comparable to Pyrefly and ty. We limited parallelism to 10 threads for all projects, and ran each project 10 times with 3 warmup runs.

Type Checking Improvements​

We've made continuous improvements to type checking capabilities, these are some of the highlights. For a more detailed breakdown you can check the Pyrefly documentation or recent release notes.

New incompatible-comparison diagnostic catches comparisons like int == str where operand types can never overlap.

Smarter TypeVar default handling : parameters like x: T = 0 now correctly validate defaults against constraints, and the default is used when solving type variables in calls.

Frozen dataclass enforcement : frozen dataclasses now reject manual __setattr__/__delattr__ overrides.

Descriptor field recognition : annotation-only descriptor fields like SQLAlchemy's Mapped type are now properly recognised.

PEP 661 (Sentinel Values) support : PEP 661 sentinels (builtins.sentinel in Python 3.15+, typing_extensions.Sentinel in lower versions) are fully supported.

PEP 800 (disjoint base) support : the @disjoint_base decorator (imported from typing in Python 3.15+, typing_extensions in lower versions) is now fully supported.

Tensor Shape Checking​

Since the experimental release of tensor shape checking, we've been excited to see your enthusiasm for this new feature. During this release we've been working on making it easier for early adopters to get started using the feature and contribute improvements.

Tensor shape operations now live in a dedicated stubs sub-directory (tensor-shapes/torch-stubs). This moves shape logic out of the type checker's Rust internals and into editable stub files, making it easier to extend and maintain shape definitions for new operations.

We've also set up a pyrefly_torch_shape_demo repository, which includes a minimal demonstration project showing how to set up experimental Pyrefly tensor shape checking for PyTorch code. The demo shows you how to clone a copy of the experimental stubs in the Pyrefly repository which should allow you to easily patch the stubs and submit a PR to Pyrefly if you find bugs or missing features you need.

Language Server / IDE Improvements​

v1.1 adds new refactoring tools, smarter completions, and better navigation to the language server, among other things. For a more detailed breakdown you can check the Pyrefly documentation or recent release notes.

Move module member and move symbol to new file : restructuring your codebase no longer means manually updating imports everywhere. Move a function or class to a different module (or extract it into a new file), and Pyrefly rewrites all consumer imports across your codebase automatically.

Convert dict to TypedDict, dataclass, or Pydantic model : if you have a dict literal that's grown complex enough to deserve a proper type, a new code action can convert it and add the necessary imports for you.

Pytest fixture support : go-to-definition and find-references now work for pytest fixtures used as function parameters, so you can navigate directly to a fixture's definition instead of searching for it manually.

Literal value completions : when you're assigning to a variable or returning from a function with a Literal type, the editor now suggests the valid values.

Sphinx docstring links : :meth:, :class:, and :func: cross-references in docstrings now render as clickable links in hover tooltips, making it easier to navigate documentation without leaving your editor.

We're also excited to see more IDEs leverage Pyrefly's speed and robustness to bring enhanced experiences to their users. JetBrains now offers Pyrefly as an external type provider in PyCharm 2026.1.2, and Microsoft is building early preview support for Pyrefly in Pylance via the new Type Server Protocol.

Other Usability...

pyrefly type tensor release checking shape

Related Articles