NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #1250 most downloaded on PyPI
A fast type checker and language server for Python with powerful IDE features
Latest stable
1.4.1
Last release 17 days ago
05 Nov 2026
Ships on a steady schedule
a new release about every 2 weeks
Most releases are documented
notes for 40 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
2 years old
154 releases · first in 2025
Drag across the ruler to compare, or tap a release to open it.
Full Changelog : 1.4.0-dev.4...1.5.0-dev.1
Full Changelog: 1.4.0-dev.4...1.5.0-dev.1
Full Changelog: https://github.com/meta/pyrefly/compare/1.4.0-dev.4...1.5.0-dev.1
Pyrefly v1.4.1 is a patch release that fixes bugs in pyrefly coverage . With these fixes, you can use pyrefly coverage check as a pre-commit hook ( py
Release date: November 4, 2026
Pyrefly v1.4.1 is a patch release that fixes bugs in pyrefly coverage. With these fixes, you can use pyrefly coverage check as a pre-commit hook (pyrefly-coverage-check in pyrefly-pre-commit).
pyrefly coverage now gives the same result on every run. Before, an attribute that inherits its annotation from a base class in another module could be reported as typed on one run and untyped on the next.pyrefly coverage report no longer panics when a pager or another program closes the output pipe early.pyrefly coverage no longer reports an excluded function or class (for example, one decorated with @type_check_only or @no_type_check) as an untyped variable when a module-level loop follows it.pyrefly coverage now counts a variable as typed when its value is an explicitly parameterized constructor call, such as x = set[int]().pyrefly coverage understands Cython pure Python mode declarations in .py files.pyrefly coverage skips the solver for annotations that are absent or already solved, which makes it faster on large projects.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.
pip install --upgrade pyrefly==1.4.1Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
The incompatible-overload-residual error kind is renamed to incompatible-overload-argument . The old name still works as a deprecated alias.
Release date: October 14, 2026
Pyrefly v1.4.0 bundles 1191 commits from 66 contributors.
.venv), so your editor and your command line use the same version. If the environment has no Pyrefly, the extension falls back to its bundled binary. Set pyrefly.pyreflyExecutable to bundled to keep the old behavior. See Pyrefly binary selection.sys.path as an editable install. Pyrefly treated those directories as installed packages and skipped them, so errors in workspace members went unreported. Pyrefly now checks editable sources inside your project, while regular site-packages stay excluded.basedpyright sections in pyproject.toml and applies the matching type checking mode preset.unknown-attribute-access, unknown-return-type, untyped-function-decorator, and uninitialized-instance-variable help you find where Any enters your code.jax-pyrefly-stubs package.These may change your editor setup or surface new errors in code that checked cleanly under v1.3.0.
--typeshed-path now replaces the bundled typeshed entirely instead of overlaying it.incompatible-overload-residual error kind is renamed to incompatible-overload-argument. The old name still works as a deprecated alias.site-package-path is renamed to site-packages-path. The old name still works.basedpyright configuration sections in pyproject.toml and applies appropriate type checking mode presets, making it easier to migrate from BasedPyright.extra_items are now instantiated correctly, extra items can supply missing arguments, and definitely_seen calculation in callable checking has been fixed.Any appears in the expected type.incompatible-overload-residual error kind has been renamed to incompatible-overload-argument (the old name remains as a deprecated alias).uninitialized-instance-variable check for annotated instance attributes never assigned in __init__ or class body, including @dataclass(init=False) fields.functools.partial now uses standard quantified finalization and handles generic overload targets.if/else blocks where all paths diverge.sys.version_info comparisons against tuples with release levels like (3, 14, 0, "beta").__get__ calls.type(...) calls in annotations now suggest valid type forms like types.NotImplementedType, types.EllipsisType, None, types.ModuleType, or type[MyClass].TYPE_CHECKING = False) no longer report their suites as unreachable.Never containers (list[Never], dict[Never, Never], etc.) are now recognized as falsy.max/min calls with key= and default= no longer report argument errors from rejected union hint members.Annotated metadata is no longer type checked, which removes spurious errors.Any, or whose decorator returns T | Any, now bind correctly.__new__ inherited from an intermediate NamedTuple subclass is now handled correctly.Any operand now infer bool.python-version below 3.5 is now rejected with an error instead of crashing.pyrefly.pyreflyExecutable setting (from-environment or bundled) controls this. Selecting a different interpreter restarts the server with the new binary when it changes.configPath settings and reloads configuration when those files change..pyi) docstrings over implementation (.py) docstrings when both exist..py files.__all__ entries and handles re-export cycles.workspace/didChangeConfiguration on python section.pyrefly/typeFacts request for batch type queries.--config to pin config for every file.Callable class attributes now bind self when first parameter is the containing class.select and with_columns now handle both positional and keyword arguments correctly, preserving schema information.with_columns outputs, and sole-argument list expansion rules.OutputCount enum to distinguish provable width from unknown width.pl.col. attribute completion, suggesting columns from the enclosing DataFrame operation.filter, sort, unique, and drop_nulls methods.QuerySet.annotate() now preserves keyword annotation attributes on result rows for attribute lookup and LSP completion.to= keyword argument resolution.ForeignKey keyword-form to= resolution.pyrefly completion command to generate shell completion scripts for fish, bash, and zsh.baseline-auto-update project setting that automatically prunes baseline files when saving files in the IDE.extends support for layered configurations.site-package-path to site-packages-path with backward compatibility.--typeshed-path to act as a full typeshed replacement instead of an overlay over the bundled typeshed.embed::Checker::try_new_with_typeshed to allow embedders to replace the bundled stdlib typeshed with in-memory .pyi stubs, useful for sandboxed interpreters like Monty.--report-glean-ownership flag to emit Glean ownership units for ACL-protected paths.--report-glean to write compact JSON instead of pretty-printed.unknown-attribute-access error kind for accessing attributes whose type is unknown.unknown-variable-type to report loop, unpacking, and with targets in addition to plain assignments.untyped-function-decorator check for decorators that return unknown types.untyped-class-decorator check for class decorators that return unknown types.default-severity for potential-bad-keyword-argument to be ignore as documented.bad-keyword-argument instead of potential-bad-keyword-argument.unknown-return-type for returning unknown values from unannotated functions and lambdas.untyped-namedtuple for collections.namedtuple without field types.assert-type-unspellable-subtype for unspellable types that are subtypes of expected type.unannotated-return false positive on __init__ methods.parking_lot for per-module computing locks, reducing memory footprint in large projects.Answers step directly instead of nested shared ownership.Require::Exports for implicit dependencies instead of Require::Everything.Elements wrappers where postponed annotations allow it.shape_extensions.Shaped and shape_extensions.shape_vars, allowing libraries to use shape types without requiring downstream users to use Pyrefly.no-any-return warnings to avoid false positives when the return type union already contains Any or Unknown.int and bool annotations.torch.unique stub.Parameter type.AdaptiveAvgPool2d size support and one-bound torch.randint overload.torch.is_tensor narrowing support.Series masks.jax.typing.ArrayLike shape-aware.np.interp type by adding missing __float__.jax-pyrefly-stubs. This is the first stable release that includes them.abs support in shape arithmetic.ndarray to be assignable to SupportsAbs by adding missing __abs__.+, -, *, //.jaxtyping configuration option to enable experimental jaxtyping shape checking support.jax.lax.scan shape inference for tuples of arrays.Tensor.T shape tracking now reverses axes.nn.Module registration types now fall back to the declared parameter type.Many of the changes above came from user reports: we closed 87 GitHub bug issues this release 👏 Here are some highlights:
TypeVarTuple were not assignable to gradual types. Pyrefly was incorrectly wrapping the tuple in an extra layer, causing tuple[int, *Ts] to be rejected when assigned to tuple[Any, *Ts].select and with_columns. Previously, select lost schema information for keyword expressions and with_columns lost it for positional expressions. Both now preserve schema correctly.@property decorators on methods with extra required parameters were not flagged as errors. Pyrefly now validates that property getters have the correct signature.__get__ calls. When a descriptor's argument type contained Any, the first overload would incorrectly win instead of properly evaluating all branches.stubgen. Generating a .pyi for a single file with a large transitive import closure previously used ~14 GB; it now uses comparable memory to pyrefly check by using Require::Exports instead of Require::Everything.bad-return error for generator functions with Iterator[X] | T return annotations. Pyrefly now correctly accepts return statements with non-None values in such generators.TypeIs[T] guards with free TypeVars producing no narrowing. When a TypeIs guard used a free TypeVar as its type argument, Pyrefly now correctly narrows to the TypeVar's bound.max/min key lambdas when default= is passed. Pyrefly was incorrectly typing the key callable's parameter from the expected type of the whole call rather than from the iterable's element type.try/except, inference would degrade and report spurious errors.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.
pip install --upgrade pyrefly==1.4.0Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @rchen152, @kinto0, @connernilsen, generatedunixname2066905484085733, @asukaminato0721, @jakevdp, @samwgoldman, @grievejia, @ndmitchell, David Tolnay, generatedunixname1699489071355949, @yeetypete, @QEDady, @javabster, @shahhamdihassan, @manmartgarc, @DetachHead, @yangdanny97, @alexander-beedie, generatedunixname89002005307016, @gaborv, @MarcoGorelli, @tonyyuyiding, @nitishagar, @vgvr0, @tobyh-canva, Catherine Gasnier, @stepanhruda, @pavelzw, @hrolfurgylfa, @NathanTempest, @oprypin, @arthaud, @akhil9tiet, @Aayushyaash, @savagecx, @n-gao, @dedsec-terminal, @Vishwaspatel2401, Willem Kokke, @Aniketsy, @Pager-dot, Alan Kurusingal, @digvijaysai29, @igorsugak, @shobhitmehro, @Trighap52, @maggiemoss, @dantrapp, @fineguy, @itamaro, @danielpassy, @aodihis, @kain88-de, Boyan Atanasov, @Parzivalart3mis, @cweider, @eriksimonson, @Divyansh151005, @iamhaseebn, @nikhil-CLTI, @WilliamK112, @nikmos3, @Wilfred, @kevin9327
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Full Changelog : 1.4.0-dev.3...1.4.0-dev.4
Full Changelog: 1.4.0-dev.3...1.4.0-dev.4
Full Changelog: https://github.com/facebook/pyrefly/compare/1.4.0-dev.3...1.4.0-dev.4
About dev releases Dev releases (versions like X.Y.Z-dev.N ) are non-stable snapshots cut periodically from trunk. They give early adopters a chance t
Release date: October 1, 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.4.0-dev.3 bundles 86 commits from 19 contributors.
This is a short snapshot — three days after v1.4.0-dev.2 — so it is a small release focused on unreachable-code reporting and language-server fixes.
except clauses that can never be entered, redundant exception classes inside a reachable except clause, and dead code after a call that never returns.lsp-types fork to gen-lsp-types 0.11.0.bad-return for a generator function annotated Iterator[X] | T.script rather than script.py, got no diagnostics in the editor. Their errors were computed and then dropped before publishing, because the default project-includes globs cannot match a path with no extension. These files are now reported, and they respect project-includes by matching as though they ended in .py.Never.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.
pip install --upgrade pyrefly==1.4.0-dev.3Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @connernilsen, @rchen152, @kinto0, @asukaminato0721, @samwgoldman, @grievejia, @shobhitmehro, @jakevdp, @nitishagar, @shahhamdihassan, @arthaud, @Trighap52, @maggiemoss, @dantrapp, @tonyyuyiding, @MarcoGorelli, @igorsugak, @NarxPal
JAX stub support is still under development and is not yet available on PyPI. The JAX improvements below describe ongoing work in the repository rather than an installable stub package in this release.
svd shape typing is improved.jnp.cross no longer accepts 2D vectors.Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Release date: September 28, 2026
Release date: September 28, 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.4.0-dev.2 bundles 493 commits from 20 contributors.
X | None annotations with an unknown XPyrefly now decides whether | builds a type union from the type-form context of the expression, instead of from the types of its operands. Before this change, an annotation such as UnresolvedType | None (for example, when UnresolvedType comes from a missing import) was evaluated as plain Unknown, and the | None was silently dropped. Pyrefly now evaluates it as Unknown | None.
This is more correct, but it can surface new errors, such as missing-attribute on None, in code that uses unresolved types in Optional-style annotations. Please try this dev release and report any false positives. (#4846)
stdlib/VERSIONS file of a custom typeshed, and it notices when that file changes.with statements, branches that are decided by the type of their test, and except clauses that can never match.Strict types, such as StrictInt, now enable strict mode for the field.TypeVarTuple variance is now checked.NewType over an abstract class no longer produces a false-positive bad-instantiation error.pyrefly.toml file is added or removed, and Pyrefly rewatches files when an explicitly configured config file changes.initialize response now includes serverInfo.match value pattern, attribute completion now ranks enum members that earlier case arms already cover lower.column-ordered mode, and the language server matches baselines in batches.Any. See also the notable change above.Enum.value no longer widens a literal value to its base type (for example, to str).PrivateAttr) are no longer treated as frozen.pk the correct type when the primary key is a ForeignKey(..., primary_key=True).pyrefly suppress now writes # pyrefly: ignore[code] without a space before the bracket, which matches the documentation.__init__.Mapping in a ** dict unpacking.stubgen no longer keeps the full analysis of the whole import closure in memory.__get__ overload with a self type of Concatenate[ObjT, P1] and a sibling TypeVar now matches correctly.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.
pip install --upgrade pyrefly==1.4.0-dev.2Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @connernilsen, @rchen152, @kinto0, @asukaminato0721, @samwgoldman, @jakevdp, @yeetypete, @MarcoGorelli, @grievejia, Abby Mitchell, @Pager-dot, @arthaud, @digvijaysai29, David Tolnay, @yangdanny97, @Aniketsy, @QEDady, @alexander-beedie, Alan Kurusingal
JAX stub support is still under development and is not yet available on PyPI. The JAX improvements below describe ongoing work in the repository rather than an installable stub package in this release.
IntVar[N] runtime wrapper supports dimension arithmetic. Bare *tuple[...] and *IntTuple splats are now accepted in shapes.random, lax, pad, split, expand_dims, and other operations, and the top-level jax namespace now has stubs.Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Release date: September 18, 2026
Release date: September 18, 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.4.0-dev.1 bundles 98 commits from 13 contributors.
uninitialized-instance-variable check reports instance attributes that may be read before assignment, including fields on dataclasses declared with init=False.functools.partial, independently pruned arguments, and writable callback variance.annotate() calls now add their declared attributes to the resulting queryset type.__self.We closed 3 bug issues this release 👏
__self, such as methods on loguru.Logger.dict, list, and set literals passed to mapped_column(default=...) and recommend default_factory instead.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.
pip install --upgrade pyrefly==1.4.0-dev.1Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@rchen152, David Tolnay, @dependabot, @Kylei, @dedsec-terminal, Oleh Prypin, Gábor Varga, @jakevdp, @jasonnathanieln, @stroxler, @ndmitchell, @connernilsen, @asukaminato0721
JAX stub support is still under development and is not yet available on PyPI. The JAX improvements below describe ongoing work in the repository rather than an installable stub package in this release.
The current
einopsstubs are limited to Torch tensors. We are still exploring how to support multiple array packages.
ArrayLike inputs more broadly, with improved shape inference for linspace, logspace, and geomspace.torch.where and bare @torch.no_grad.pyrefly-shape-extensions now supports Python 3.10 and provides runtime markers for regular nested lists.Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Release date: September 28, 2026
Release date: September 28, 2026
Pyrefly v1.3.2 is a patch release that fixes regressions in how Pyrefly infers the type of a variable after it is assigned a value of type Any.
Any:
Any (a value with no known type, such as the result of an unannotated function or an unresolved import) to an annotated variable once again produces Unknown. It no longer turns into an explicit Any.Optional[T] or T | None is narrowed to None and then reassigned inside that branch, Pyrefly no longer adds the annotation's None back after the branch. For example, x: Any | None followed by if x is None: x = get_any() now gives Any instead of Any | None.Any, assigning Any to it now narrows the variable to Any. For example, x: Any | None followed by x = x or get_any() now gives Any instead of Any | None, so later attribute access no longer reports a false missing-attribute error on None.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.
pip install --upgrade pyrefly==1.3.2Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
Release date: September 14, 2026
Release date: September 14, 2026
Pyrefly v1.3.1 is a patch release with a single bug fix.
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.
pip install --upgrade pyrefly==1.3.1Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
Release date: September 10, 2026
Release date: September 10, 2026
Pyrefly v1.3.0 bundles 934 commits from 71 contributors.
mock.patch targets, unsupported dataclass_transform arguments, incompatible Protocol.__call__ overrides, and unimplemented abstract methods. Pattern-match exhaustiveness, overload resolution, narrowing, and generic inference are also more accurate.assert x is not None. Inlay hints can also insert required imports and link to definitions.# type: ignore[pyrefly:<code>] suppresses a specific Pyrefly diagnostic without hiding unrelated errors on the same line.--replace-untyped-imports-with-any option replaces selected third-party packages that lack stubs or a py.typed marker with Any, and pyrefly init translates mypy's follow_untyped_imports setting automatically.--prune-baseline, and reject them in CI with --error-stale-baseline.pyrefly-numpy-stubs package brings shape checking to NumPy. These stubs use a new type-level shape DSL, which replaces the old @shaped_array API.Series and schema annotations. pandas columns= projections now preserve the requested schema as well.non-exhaustive-match-open-type error kind.hasattr, wide Literal unions, callable values, reverse tuple slices, and values assigned from Any.bad-dataclass-descriptor error kind.unittest.mock.patch are validated, with nonexistent attributes reported as missing-attribute-patch-target warnings.regex error kind.ForeignKey, OneToOneField, and ManyToManyField relationships in the same file, while Django REST Framework serializers avoid false override errors for common Meta and field patterns.update().values() checks values against mapped model fields.register_buffer and register_parameter.assert x is not None when an optional value needs narrowing.**kwargs: Unpack[TypedDict] more accurately.pyrefly.lspPath values now work correctly with Windows, home-relative, and workspace-relative paths.extraSearchPaths and extraProjectExcludes during initialization, improving integration with editors that manage their own import paths and excluded directories.pyrefly/typeErrorDisplayStatusChanged notification.getComputedType requests fell from 668 seconds to 3.4 seconds, while total request time fell from 671 seconds to 6.4 seconds.# type: ignore[pyrefly:<code>] comments suppress only the named Pyrefly diagnostic without hiding unrelated errors on the same line.type-ignore-unknown-tag-behavior option controls how tags belonging to other tools affect Pyrefly diagnostics: they can have no effect, downgrade diagnostics to warnings, or retain the legacy blanket-suppression behavior.replace-untyped-imports-with-any option replaces selected installed third-party packages with Any when they provide neither stubs nor a py.typed marker.pyrefly init automatically translates mypy's global and per-module follow_untyped_imports settings to the new option.baseline-matching-mode can match diagnostics by their column or concise description, reducing churn when unrelated code moves.baseline-format can write full metadata or a minimal representation containing only the fields needed for matching.baseline-error-level can expose matched diagnostics at info, warn, or error severity instead of hiding them, with baseline provenance included in text, JSON, SARIF, and summary output.--prune-baseline removes stale entries without recording new errors, while --error-stale-baseline lets CI reject a baseline containing obsolete entries.treat-all-caps-as-final option treats reassignment of ALL_CAPS names as a bad-assignment.pyrefly.toml using a PEP 440 version constraint.python-interpreter-find-command setting supports custom interpreter discovery.--output destinations with different formats can be specified in one CLI invocation.pants-pyrefly plugin.jax.lax.pyrefly-numpy-stubs package brings shape-aware checking to NumPy alongside the existing PyTorch support.@shaped_array API has been removed; custom shape annotations must migrate to IntTuple-generic classes and the V2 DSL.select, with_columns, group_by().agg(), joins, CSV readers, and lazy/eager conversion, with typed Series, nested and owned dtypes, and schema information from variables, calls, and TypedDicts.Annotated[DataFrame, Schema(...)] supports exact and open schema contracts, while the new column-schema-mismatch and duplicate-column errors catch invalid schemas and conflicting output columns before runtime.columns= now project their inferred schema onto the requested column set and order.We closed 88 bug issues this release 👏
__new__ method. Pyrefly now detects direct recursive __new__ targets.NamedTuple was defined inline inside a match statement. A dedicated MatchSubject binding key now prevents collisions.py.typed packages installed in site-packages now recognize the package's public names as re-exports.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.
pip install --upgrade pyrefly==1.3.0Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@shobhitmehro, @rchen152, @asukaminato0721, generatedunixname2066905484085733, @yangdanny97, @grievejia, @kinto0, generatedunixname949130641157030, @lyydsheep, @ndmitchell, @stroxler, generatedunixname89002005232357, @connernilsen, @jcarreiro, @patrickswedish, @randolf-scholz, @vincevannoort, @renz011tzar, @ak4-sh, @tobyh-canva, @KotlinIsland, @Sanjays2402, @alexander-beedie, David Tolnay, @javabster, @samwgoldman, @IBlackVoid, @nitishagar, @WilliamK112, @NathanTempest, @ytausch, @xaskii, generatedunixname1431085361989520, @a7or, @markselby9, @heejaechang, Willem Kokke, @dillydill123, @kakolla, generatedunixname1699489071355949, @ting-hong-shieh, @kavix, @Vishwaspatel2401, @danielgaskins, generatedunixname89002005307016, @fangyi-zhou, @MarcoGorelli, @thomaspolasek, @tague, @paranoa233, @d34db3ff, @AMR5210, @DarkNightForge, @ternaus, @austin3dickey, @cakeni, @lolpack, @jakevdp, @Pager-dot, @tkim602, @anishfyi, @mangeshraut712, @jorenham, @Pyxelate, @DetachHead, @kavyansh18, @rootkiller6788, @auscompgeek, Khan Mohammed, @KSAGlory, @devteamaegis
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Release date: September 03, 2026
Release date: September 03, 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.3.0-dev.4 bundles 198 commits from 23 contributors.
self and displaying hints for all user-visible parameters.__call__ method.replace-untyped-imports-with-any flag and config option now replace imports from third-party packages missing stubs or py.typed markers with Any, matching mypy's follow_untyped_imports behavior.follow_untyped_imports setting is now auto-migrated to the new replace-untyped-imports-with-any option.We closed 15 bug issues this release 👏
__tracebackhide__ as an unused variable, since pytest reads it implicitly when formatting tracebacks.self and aligning hints with actual parameters.missing-attribute errors, since slot enforcement no longer applies to subclasses that don't declare slots themselves.type[T] calls with custom metaclass returns to only substitute the constructor result with T when the inferred return is compatible with the bounded class, preserving unrelated metaclass __call__ return types.iter([0]) to infer Iterator[int] instead of Iterator[Any] by no longer using the generic Any bound from iter's signature to infer list element types.__all__ state sticky across later mutations, so append, extend, and remove calls preserve DunderAllKind::Unresolvable and star imports continue using fallback behavior.type(protocol_value) to produce type[Protocol] representing the unknown concrete runtime implementation, preventing false invalid-argument errors when used with isinstance.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.
pip install --upgrade pyrefly==1.3.0-dev.4Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @rchen152, @samwgoldman, @grievejia, @jakevdp, @asukaminato0721, @kinto0, David Tolnay, @connernilsen, @ndmitchell, @DarkNightForge, @cakeni, @nitishagar, @shobhitmehro, @Pager-dot, @tkim602, @NathanTempest, @anishfyi, @mangeshraut712, @jorenham, @alexander-beedie, @Pyxelate, @yangdanny97
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Importing a re-exported @deprecated class or function now produces a deprecation warning at the import site, not just at the original definition.
Release date: August 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.3.0-dev.3 bundles 285 commits from 33 contributors.
(self: A) -> None is not assignable to (self: A) -> None when the two sides genuinely differ.(int) -> str | None is no longer ambiguous.Any to a variable with a declared type no longer erases the annotation, so later checks on that variable keep working.Literal type hints are no longer discarded when solving generic calls, fixing false errors on Literal unions with more than four members.hasattr can now be deleted with del, and the narrowing is cleared afterwards so later reads correctly error again.TypeVar by a same-named type parameter in an enclosing scope is now detected and reported.match statements on tuple subjects now narrow to Never for exhaustiveness, so assert_never works on multi-subject matches.match statements is now available as an opt-in.__get__ is now applied when the attribute type is a union, rather than only for a single class.assert callable(x) now narrows to a callable returning Any instead of object, matching what the assertion is usually meant to express.map(), so map(lambda foo: ..., items) is type checked.TypeForm can no longer be used as a type annotation, matching mypy, pyright, and ty.**kwargs in a class header is now supported, with the unpacked fields validated against the class keywords.*args and **kwargs alongside known positional and keyword parameters are now checked against the keys the mapping actually provides.TypeVarTuple in a callable parameter now accounts for optional arguments, so passing only the required ones checks.enum.Flag unions now match typing.Self in methods and classmethods, so combining members with | and returning Self checks.[::-1]) of a fixed-length tuple now preserve the arity and the positional element types.@deprecated class or function now produces a deprecation warning at the import site, not just at the original definition.__all__.remove(...) is now taken into account when determining explicit exports, so removed names are no longer importable without an implicit-reexport error..so and .dll modules are now findable and treated as Any rather than failing to resolve.== comparison.regex error kind.Self __call__, a recursive TypedDict, a recursive type alias used in a subscript, and protocol member lookup reached through __getattr__.change_signature refactoring lets you edit a function's parameters and have call sites updated for you.pass behind where an import cannot simply be deleted.assert x is not None for an optional value, so you can narrow it without writing the assertion yourself.TypeVar or ParamSpec now also updates the string name argument in its constructor call.: or =.not now highlights the full unary expression instead of just the operator.__init__ call now jumps to the specific field."accounts.urls"..ipynb files on disk now get language server features too.pyrefly.lspPath VS Code setting is now resolved against the workspace root rather than the extension's working directory.bad-override errors for the inner Meta class pattern or for declared fields named like Field attributes.update() values are now checked against the mapped fields of the model, and SQL expressions are accepted in a values() call.Field() defaults now infer correctly against wide Literal annotations.self.register_buffer(...) and self.register_parameter(...) in a torch.nn.Module subclass are now recognized instead of reported as missing.python-interpreter-find-command setting lets you supply your own command for discovering the Python interpreter.pyrefly.toml can now enforce a required Pyrefly version at runtime, using PEP 440 constraints.pyvenv.cfg as the virtual environment itself; project discovery looks for conventional .venv, venv, and env children instead.site-packages no longer shadows Pyrefly's bundled stubs, which previously produced conflicting definitions of the same type.pyrefly init no longer emits redundant ignore-missing-imports entries alongside a global * wildcard when migrating a mypy configuration.from import statements are now ignored rather than panicking.pyrefly-numpy-stubs package provides shape-aware NumPy stubs, alongside the existing pyrefly-torch-stubs.We closed 28 bug issues this release 👏
TypeVar used as a type argument in a class base list produced a false invalid-type-var error saying the type variable was not in scope.Literal types with more than four members lost type inference, producing false errors on Pydantic Field() defaults and on any generic call given a wide Literal hint.TypeVar-typed keyword arguments depended on the order the arguments were written in, so the same call could check or fail depending on argument order.bad-override when a subclass assigned a matching function to a callable ClassVar inherited from its parent.enum.Flag methods that combine members with | and return typing.Self being reported as returning the wrong type.bad-override errors on Django REST Framework's ModelSerializer.Meta pattern, which is a configuration class rather than a true inheritance override.assert callable(x) narrowing too aggressively: calling the narrowed value now yields Any rather than object.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.
pip install --upgrade pyrefly==1.3.0-dev.3Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @samwgoldman, @rchen152, @asukaminato0721, @grievejia, David Tolnay, @shobhitmehro, @connernilsen, generatedunixname1699489071355949, @ting-hong-shieh, @kavix, @WilliamK112, @lyydsheep, @Vishwaspatel2401, @ndmitchell, @markselby9, @danielgaskins, @kinto0, @NathanTempest, generatedunixname89002005307016, @fangyi-zhou, @javabster, @MarcoGorelli, @thomaspolasek, @tague, @paranoa233, @d34db3ff, @AMR5210, @DarkNightForge, @ternaus, @austin3dickey, @cakeni, @lolpack
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
About dev releases Dev releases (versions like X.Y.Z-dev.N ) are non-stable snapshots cut periodically from trunk. They give early adopters a chance t
Release date: August 17, 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.3.0-dev.2 bundles 126 commits from 29 contributors.
__call__ are now checked for override consistency like any other method, catching incompatible signatures that would fail at runtime.TypeForm, fixing cases where valid type expressions were incorrectly rejected.no-any-return no longer fires on functions declared to return object, since all runtime values satisfy object.__init_subclass__ attributes are now detected, catching runtime errors when a class inherits from a parent with a non-callable __init_subclass__.object for TypeVars, tuple[()] for TypeVarTuples, ... for ParamSpecs) rather than always using Any.preset=auto default behavior.--output destinations with different formats can now be specified on the command line, enabling simultaneous output to multiple formats.--error-unused flag exits non-zero when the baseline contains unused entries, ensuring CI fails until the baseline is refreshed.--remove-unused flag rewrites the baseline with only entries that still match, allowing the set of suppressed errors to shrink without recording new ones.baseline-error-level configuration option, with provenance markers indicating which results matched the baseline.We closed 16 bug issues this release 👏
x: int followed by y = x incorrectly reported that x could not be found.datetime.datetime is now correctly recognized as a subtype of datetime.date, fixing false positives when dates and datetimes were used interchangeably.*args: *tuple[*Ts, Suffix] annotations now correctly track the variadic tuple shape during call matching, accepting arguments that match the prefix, middle, and suffix elements.__init__, fixing false errors when an annotation's type implements __get__ but no class-level descriptor exists.Literal types can now match TypeForm, fixing cases where valid type expressions were rejected.__all__ are now preserved even when a later dynamic append or extend cannot be resolved, fixing false implicit-reexport errors for names like torch.Tensor.init=False and required/optional status, fixing false errors when dataclass-transform field specifiers return descriptors.* marker, so args= becomes *args= in signature help.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.
pip install --upgrade pyrefly==1.3.0-dev.2Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
@rchen152, generatedunixname2066905484085733, @yangdanny97, David Tolnay, generatedunixname949130641157030, @javabster, @shobhitmehro, @asukaminato0721, @samwgoldman, @kinto0, @alexander-beedie, @grievejia, @connernilsen, @tobyh-canva, @IBlackVoid, @nitishagar, @WilliamK112, @lyydsheep, @NathanTempest, @ytausch, @patrickswedish, @xaskii, generatedunixname1431085361989520, @a7or, @markselby9, @heejaechang, Willem Kokke, @dillydill123, @kakolla
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
*Release date: August 06, 2026*
Release date: August 06, 2026
About dev releases Dev releases (versions like
X.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.3.0-dev.1 bundles 162 commits from 23 contributors.
Protocol as an instance of _ProtocolMeta in type checks, and Pyrefly correctly models Protocol using typeshed's _ProtocolMeta, making it assignable to ABCMeta.Sequence or other abstract base classes now correctly report when abstract methods remain unimplemented, even when the class doesn't directly extend ABC.type[type[X]] now uses the metaclass for more precise results instead of triggering internal errors.Any now preserve dynamic attribute access instead of converting to object, fixing false missing-attribute errors.list[T]() where T is unbound) now emit errors at the call site.metaclass=type declarations are now allowed.import statements automatically.Unknown as typing.Any to produce valid Python source.from foo import X style imports by default when possible, falling back to import foo only when the module is already imported that way.case _ wildcard now resolves to the match subject expression's type, not just the first token of the subject.**kwargs: Unpack[TypedDict] parameters, exposing each TypedDict field as a completable keyword argument.__call__ signature.__new__ to a callable, fixing constructor argument inference.df.with_columns(...) now infers each added or overwritten column's dtype from its Polars expression instead of leaving it Unknown.df.select(...) produces a precise column schema when its arguments are Polars expressions, not only plain column-name strings.df.group_by(...).agg(...) calls now infer a precise column schema, including grouping keys and aggregation outputs.pl.Series("a", [1]) now reveals Series[Int64] instead of the opaque Series class, carrying element dtypes forward.df.get_column(name) and df.to_series(index) now return typed Series[dtype] instead of an opaque Series.schema= whose column set doesn't match the data now report a clear column-schema-mismatch error.Final or Literal[str]) instead of requiring bare literals.TypedDict-typed value now infer columns from the TypedDict fields.df.lazy() and df.collect() now preserve the column schema across the conversion.pl.DataFrame[Schema] annotations now read the schema class's columns, so annotated parameters carry their schema into the function body.pl.read_csv and pl.scan_csv with inline schema= dictionaries now infer complete CSV schemas, and reader options like projections and overrides are applied.df.fill_null now models integer and float widening according to Polars runtime behavior.df[[]] (empty list subscript) now preserves the original schema instead of producing an empty schema.duplicate-column error.columns= now project the data onto the given column set and order.Pyrefly now understands reverse relationships between Django models in the same file:
ForeignKey, with the default <source>_set attribute or a custom related_name.OneToOneField relationships expose the source model directly on the reverse side.ManyToManyField relationships add a manager with the correct model type.related_name placeholders (class and app-label) are filled in, and disabled or malformed names create no attribute.dataclass_transform now rejects unsupported keyword parameters, as required by the typing specification.mock.patch string targets are now validated, reporting missing imports or attributes at the string literal location.mock.patch targets are reported as warnings under a new missing-attribute-patch-target error kind.# character, ensuring a valid UTF-8 boundary even after multibyte characters.ALL_CAPS variables as Final by enabling the treat-all-caps-as-final configuration option, which reports reassignment errors.--typeshed-path option now works correctly when checking typeshed's own stubs, deriving module names from <typeshed_path>/stdlib.We closed 14 bug issues this release 👏
__getattr__ or __getattribute__ were incorrectly rejected in protocol subtyping. Pyrefly now allows these fallback methods to satisfy protocol members, with special handling for class objects and certain dunders.Sequence or other abstract base classes now correctly report unimplemented abstract methods, even when the class doesn't directly extend ABC.__new__ method. Pyrefly now detects direct recursive __new__ targets.Key Anon already exists) when a NamedTuple was defined inline inside a match statement. A dedicated MatchSubject binding key now prevents collisions.raise inside a context manager that returns True from __exit__ no longer incorrectly narrows the type.classproperty or cached_classproperty had no type arguments. The match arm now checks for type arguments before unwrapping.A and True) no longer introduce placeholder narrowing operations, preserving the original narrowing behavior.# type: ignore comments. Unused-ignore diagnostics now underline the ASCII # character.__call__ signature.@total_ordering now recognizes non-synthesized rich comparison methods inherited through the class MRO, fixing false positives when __lt__ is defined in a base class.Type once up front, collapsing shared subtrees.Any now preserve dynamic attribute access instead of converting to object, fixing false missing-attribute errors.__new__ to a callable, fixing constructor argument inference.And more! #4430, #4417, #4387, #4315, #3678, #3334, #4380, #2313, #1130, #4388, #4386, #4390, #4399, #4443, #4455, #4457, #4464, #4447, #4436, #4441, #4442, #4451, #4452, #4456, #4458, #4460, #317, #1576, #4331, #4304, #4393, #4361
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.
pip install --upgrade pyrefly==1.3.0-dev.1
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-errorspyrefly check --remove-unused-ignoresThis 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.
@shobhitmehro, @rchen152, @asukaminato0721, generatedunixname2066905484085733, @yangdanny97, @grievejia, @kinto0, generatedunixname949130641157030, @lyydsheep, @ndmitchell, @stroxler, generatedunixname89002005232357, @connernilsen, @jcarreiro, @patrickswedish, @randolf-scholz, @vincevannoort, @renz011tzar, @ak4-sh, @tobyh-canva, @KotlinIsland, @Sanjays2402, @alexander-beedie
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Release date: September 16, 2026
Release date: September 16, 2026
Pyrefly v1.2.1 is a patch release with a single performance improvement.
getComputedType) used to solve the whole module from scratch in a throw-away transaction, then discard that work once the request finished. The solve is now committed to shared state when possible, so later requests for the same file reuse the earlier solve instead of repeating it. In a captured Pylance session with 43,811 getComputedType requests, median latency for non-open-file requests dropped from 16.9ms to 0.07ms, and total TSP request time for that session fell from about 671s to about 6.4s.pip install --upgrade pyrefly==1.2.1Upgrading 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-errorspyrefly check --remove-unused-ignoresThis 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.
Auto-import completions respect python.analysis.autoImportCompletions, rank deprecated stdlib typing aliases below their modern equivalents, avoid dup…
Release date: July 31, 2026
Pyrefly v1.2.0 bundles 901 commits from 59 contributors.
@attr.s, @define, @frozen, and their variants, handling field specifiers (attr.ib(), field()), converters, validators, defaults, and private-field aliasing. Converters are typed from their real input type rather than Any, including the @<field>.converter decorator, attrs.converters.pipe, attrs.converters.default_if_none, and generic converters like copy.deepcopy. See the new attrs documentation for details.functools.partial is now type-checked instead of treated as opaque. Bound arguments are validated at construction and Pyrefly synthesizes a precise residual signature for the remaining parameters, so errors surface at both the partial(...) call and the later invocation. Generic functions, overloads, constructors, bound methods, and **Unpack[TypedDict] parameters are supported, and results expose .func, .args, and .keywords. Precise residual callable assignment is enabled by the strict and all presets or explicitly with strict-partial-subtyping.functools.singledispatch now type-check calls using the signature of the function you decorated, and registered implementations are checked against that function's first parameter. Generic singledispatch functions infer from call arguments instead of reporting Unknown.Any, with separate diagnostics for explicit and inferred cases. Off by default, and migrated automatically from mypy's warn_return_any.__match_args__ at solve time, sequence element captures read from the narrowed subject so sibling constraints refine them, and isinstance on a facet filters the parent union to matching members. Fully covered class and sequence patterns now subtract their union member from later cases.a, *rest, b = t where t: tuple[int, *tuple[bool, ...], str] types rest as list[bool].__required_keys__ and __optional_keys__, so protocols requiring them (like those in langgraph) satisfy structural checks. .get() and .pop() with literal defaults preserve the field type.asyncio.to_thread..value on an enum type now infers as the union of member literal values instead of widening to the mixed-in data type.*args/**kwargs resolve from callable hints to tuple[...] and dict[str, ...] inside the body while preserving element types in the signature.if TYPE_CHECKING is handled consistently, typing_extensions.sentinel is supported with relaxed naming restrictions, and super(cls, cls) is accepted.copy.replace is now type-checked like dataclass replacement, and isinstance(x, type) preserves type arguments when narrowing unions.Self to a subclass now preserves Self, eliminating false return errors in methods that return the narrowed receiver.populate_by_name and built-in alias_generator functions, ignores Field(init=False) to match runtime, and treats frozen as a readonly field reason.ForeignKey targets now resolve attribute expressions and string references such as "app_label.Model", preserving the generated relation and <field>_id types.FactoryMetaClass.partial marker from py.typed and merges the stubs with the runtime package, deferring to the runtime package for omitted modules while preserving .pyi-before-.py precedence for provided ones.typeshed-path now supplies stdlib stubs as well as third-party stubs, enabling complete custom-typeshed testing and overrides.__call__ signature, preserves overload docstrings at call sites, shows enum fields, wraps nested callable and Concatenate[...] signatures for readability, and covers and/or operators, augmented assignments, and union methods.python.analysis.autoImportCompletions, rank deprecated stdlib typing aliases below their modern equivalents, avoid duplicates for already-imported modules, and preserve import aliases correctly.__init__..thrift, including nested attribute and enum access and intermediate components of multi-dotted imports.NewType values now use their callable constructor signature instead of producing an invalid type[N] annotation.SymbolInformation for clients such as Helix, semantic tokens cover with ... as and except ... as bindings, and cross-file diagnostics refresh on save in strict-spec clients such as Zed.#region/#endregion markers create folding regions, and selection ranges now follow AST nesting from expression to statement to scope to document.lspArguments defaults to ["lsp"] when empty, preventing startup failures in dev containers and remote environments.implicit-bool, invalid-cast, invalid-abstract-method, unused-call-result, empty-body, missing-super-call, unsupported-dynamic-base, implicit-reexport, unknown-argument-type, unknown-attribute-type, unknown-variable-type, implicit-any-lambda, untyped-function-decorator, untyped-class-decorator, unused-type-ignore, and no-any-return.--output-format=min-text flattens multi-line headers so each error stays on one line.--output-format=code-climate produces GitLab-compatible Code Quality reports, while full-text-with-github combines readable diagnostics with GitHub workflow commands and is now used by the Pyrefly action.pyrefly coverage is no longer marked experimental.[coverage] config table with includes and excludes can target a file set different from the project globs, with --project-excludes and positional FILES... taking precedence over it.--public-only keeps public re-exports from excluded files, so a symbol is only excluded when all of its public re-export locations are. Privately named classes and their members are excluded unless exported via __all__.--fail-under always prints findings whether or not the threshold is met.pyrefly infer --dry-run previews inferred annotations without modifying files and exits unsuccessfully when changes would be made, making it suitable for CI.python-platform accepts one platform, multiple platforms, or all platforms. Platform guards are folded only when every configured platform agrees.# pyrefly: ignore-errors[code] directives selectively suppress named error codes using the same parent-kind matching as line-level ignores.suppress command's --remove-unused=type mode also removes unused # type: ignore comments.--update-baseline validates the baseline after config resolution, so a baseline configured in pyproject.toml works without repeating --baseline.[tool.mypy] section instead of silently falling back to pyright, and TOML parse errors point at the offending value rather than the start of the file.TypeAlias right-hand sides and static __all__ literals are now preserved, so re-exports survive in the stub.ClassVar[...], and multi-line parenthesized expressions keep their parentheses, preventing IndentationError in generated stubs.def with AsyncGenerator return annotations, following the typeshed convention.Callable[..., Incomplete] instead of bare Incomplete, and statements guarded by conditions other than TYPE_CHECKING are no longer dropped.bazel-check command adds Bazel-focused type-checking for projects that provide source information through JSON manifests. It is intended to collaborate with the new rules_pyrefly Bazel rule project.pkgutil namespace probes are cached during import resolution.These may surface new errors or warnings in code that checked cleanly under v1.1.0.
isinstance narrowing now consumes dynamic uncertainty before intersecting with the target type, so x: Any narrowed by isinstance(x, C) refines to C instead of preserving the Any. This closes a type-safety hole while sacrificing the gradual guarantee in exchange for more precise runtime-evidence-based narrowing.# pyrefly: ignore-errors directive placed after code now emits a misplaced-ignore warning, directing users to move it into the file preamble or use a line-level suppression.direct-abstract-base-instantiation is now separated from bad-instantiation and is a warning by default.invalid-type-checking-constant is a new default error for user-defined TYPE_CHECKING constants that are not typed as bool.useless-overload-body is a new default warning for executable logic in @overload declarations, whose bodies are never executed at runtime.implicit-any-attribute now focuses on Any synthesized at an attribute assignment; propagated Any is reported separately as the off-by-default unknown-attribute-type, so per-code configurations may need updating.KW_ONLY markers, and invalid __init_subclass__ calls.TypeVars not assigned to their declared name, raw-string quoted types, defaults on self or cls, and super() in directly defined NamedTuple methods.We closed 137 bug issues this release 👏
isinstance() narrowing broke after an unrelated isinstance() check in a returning sibling branch, restoring correct narrowing behavior.TypeVar bounded by a heterogeneous tuple now preserves each positional element type instead of widening every element to their union.kw_only=True handling for SQLAlchemy-style declarative bases, preventing false "field without default may not follow field with default" errors in subclasses.enumerate() over tuple literals now preserves element types, so for i, x in enumerate(("a", "b")) types x as Literal["a"] | Literal["b"].bad-override error when a child class generic over a TypeVarTuple overrides a parent method with the same *args: *Ts signature.unannotated-return for @no_type_check functions.BaseModel fields named "self" are no longer incorrectly flagged on construction.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.
pip install --upgrade pyrefly==1.2.0
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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @shobhitmehro, @yangdanny97, @asukaminato0721, @rchen152, @kinto0, @samwgoldman, @grievejia, @jorenham, @NathanTempest, @anushamukka-dev, @ericzhonghou, @connernilsen, @tobyh-canva, @aodihis, @nitishagar, @kz357, @WilliamK112, @mikeleppane, @markselby9, @goutamadwant, @brosenfeld, @alexander-beedie, @ak4-sh, @xaskii, @qnox, @QEDady, @oprypin, @MannXo, @javabster, @fangyi-zhou, @durvesh1992, @arthaud, @vivekjm, @VasuAgrawal, @teerthsharma, @SarahMKosowsky, @roian6, @Punisheroot, @paranoa233, @olekuhlmann, @ndmitchell, @magic-akari, @maggiemoss, @lesbass, @lennardwalter, @knQzx, @Kartikey077, @JakobDegen, @ibraheemshaikh5, @hrolfurgylfa, @fhoehle, @dillydill123, @DibbayajyotiRoy, @coclique, @arogozhnikov, David Tolnay, Myles Matz, pratved64
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
> Dev releases (versions like X.Y.Z-dev.N) are non-stable snapshots cut periodically from trunk. They give early adopters a chance to try in-progress
Release date: July 24, 2026
About dev releases Dev releases (versions like
X.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.2.0-dev.3 bundles 250 commits from 29 contributors.
__required_keys__ and __optional_keys__ attributes during attribute lookup, so protocols requiring these attributes (like those in langgraph) work correctly.@<field>.converter decorator (added in attrs 26.2.0) to define converters, and the converter's input type is correctly used for the __init__ parameter.attrs.converters.pipe now types the __init__ parameter as the first converter's input type instead of Any, so invalid constructor arguments are caught.attrs.converters.default_if_none now types the __init__ parameter as <field type> | None instead of Any, matching the converter's runtime behavior.copy.deepcopy) now solve their type variables against the field's declared type, so the __init__ parameter is correctly typed.converter=tuple on a Sequence[int] field types the parameter as Iterable[int]..select(), .drop(), .rename(), and .with_columns() operations now preserve and transform the DataFrame schema, keeping column information through method chains..filter(), .sort(), and .fill_null() operations now preserve the DataFrame schema unchanged, since they only affect rows.... in display), so known columns are type-checked while avoiding false positives from dynamic column operations.functools.partial now type-checks bound arguments and synthesizes a precise residual signature for the remaining parameters, catching errors at construction and call sites.functools.partial over generic functions now preserves type variables, so bound arguments can solve them and the residual stays generic.functools.partial over overloaded functions now resolves to the matching overload branches, so later calls still benefit from overload resolution.functools.partial over class constructors and bound methods now works correctly, checking arguments and producing the expected instance type.functools.partial results now expose .func, .args, and .keywords attributes and narrow correctly in isinstance checks.functools.partial over **Unpack[TypedDict] splats now expands the TypedDict fields and checks the residual parameters correctly..value on an enum type (not a specific member) now infers as the union of member literal values instead of widening to the mixin type.__match_args__ at solve time.isinstance checks on facets (like tuple elements or union members) now filter the parent union to matching members.# pyrefly: ignore-errors directives (placed after code) now emit a misplaced-ignore warning pointing users to move them to the top.import x as y, from x import y as z) are now classified as definition contexts, so completions don't suggest module paths for them.from model import MyModel as MyModelAlias statements.and/or operators now returns the enclosing boolean expression range for better context.__init__.textDocument/selectionRange) now follow AST nesting from expression to statement to scope to document, with support for #region/#endregion markers.#region/#endregion folding markers are now recognized (including nested regions and spaced # region), independently of comment-section folding.getComputedType, getDeclaredType, getExpectedType) now resolve correctly for files that aren't open in the editor.pyrefly.*) are now ignored when running as a type server (TSP mode), so stale extension settings don't interfere with Pylance.unknown-column error kind flags reads of DataFrame columns that don't exist in the known schema.column-type-mismatch error kind flags Polars column literals whose elements cannot share one dtype.implicit-reexport error kind (default: ignore) flags imports of names that are only available through plain import/from ... import (not explicit re-exports).invalid-type-checking-constant error kind flags user-defined TYPE_CHECKING constants that aren't assignable to bool.missing-super-call error kind (default: ignore) flags __init__, __new__, or __init_subclass__ methods that override a non-object parent without calling the parent method.empty-body error kind (default: ignore) flags ellipsis-only function bodies where None isn't assignable to the annotated return type.unused-call-result error kind (default: ignore) flags discarded function/method call results whose type is informative (not None, Any, or Never).invalid-abstract-method error kind (default: ignore) flags @abstractmethod decorators in non-abstract classes.full-text-with-github output format now emits readable diagnostics followed by GitHub workflow commands, so source locations remain visible in raw logs.DataFrame construction from dictionary literals now infers a complete schema with column names and types.df[["a", "b"]]) now narrow the schema to the selected columns in the requested order..select() narrows the schema to the named columns in the order given..drop() narrows the schema by removing the named columns while preserving the original order..rename() relabels columns in the schema, handling swaps correctly and falling back on ambiguous cases..with_columns() adds or overwrites columns in the schema, appending new names and preserving untouched columns."*" and regex patterns) are now recognized, so .select("*") and .drop("^col.*$") fall back instead of erroring.pyrefly coverage check --public-only now keeps public re-exports from excluded files, so symbols are only excluded when all public re-export locations are excluded.pyrefly coverage commands now accept a [coverage] config table with includes and excludes that override project globs, so coverage can be measured on a different file set.pyrefly coverage check --fail-under now always prints findings regardless of whether the threshold is met, so users see what's missing even when passing.pyrefly coverage now excludes privately-named classes (like _Foo) unless exported via __all__, consistent with other symbol kinds.[tool.pyrefly] section are now only considered root markers, so pyproject.toml files don't shadow parent configs unless they contain Pyrefly settings.--project-excludes flag now takes precedence over coverage.excludes, and positional FILES... args also override coverage globs.fallback_search_path, so __unknown__ files count under --public-only.We closed 48 bug issues this release 👏
bad-override error when a child class generic over a TypeVarTuple overrides a parent method with the same *args: *Ts signature.__required_keys__ and __optional_keys__ attributes, so protocols requiring these attributes (like those in langgraph) no longer fail structural checks.import json).@NNN variables from leaking into tooltips.enumerate() over tuple literals now preserves element types instead of widening to a generic tuple, so for i, x in enumerate(("a", "b")) types x as Literal["a"] | Literal["b"].#region/#endregion folding markers are now recognized (including nested regions and spaced # region), independently of comment-section folding.copy.deepcopy) now solve their type variables against the field's declared type, so the __init__ parameter is correctly typed instead of leaking a bare TypeVar.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.
pip install --upgrade pyrefly==1.2.0-dev.3
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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @shobhitmehro, generatedunixname2066905484085733, @yangdanny97, @asukaminato0721, @kinto0, @anushamukka-dev, @samwgoldman, @rchen152, @NathanTempest, @jorenham, @aodihis, @tobyh-canva, @brosenfeld, @nitishagar, @goutamadwant, @grievejia, @roian6, @paranoa233, @kz357, @teerthsharma, generatedunixname949130641157030, @coclique, @SarahMKosowsky, @markselby9, @oprypin, @knQzx, @alexander-beedie, @ak4-sh
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Deprecated stdlib typing aliases (e.g., typing.List) are now ranked below their collections.abc equivalents in auto-import completions.
Release date: July 10, 2026
About dev releases Dev releases (versions like
X.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.2.0-dev.2 bundles 158 commits from 23 contributors.
functools.singledispatch now type-check calls using the signature of the function you decorated, catching argument errors like f("bad") when that function expects int. Registered implementations are also checked against that function's first parameter, so their dispatch types must be compatible.singledispatch functions now infer their generic types from call arguments instead of reporting Unknown.Any, with separate diagnostics for explicit and inferred Any returns. These warnings are off by default for backward compatibility; you can enable them explicitly, or let Pyrefly migrate the setting from mypy when warn_return_any is enabled.isinstance(x, type) now preserves type arguments when narrowing unions, so type[int] | str narrows to type[int] instead of bare type.type[Any] now make the decorated class behave dynamically, matching decorators that can substantially change the class at runtime.cls, fixing false missing-attribute errors on abstract base classes.Any/unknown items now invoke the container's __contains__ method and return bool instead of Unknown.copy.replace is now type-checked like dataclass replacement, so Pyrefly validates immutable updates more accurately.x: A | B; x.foo() correctly shows foo as a method when both A.foo and B.foo are methods.+= now shows the __iadd__ definition and type, or the right-hand side literal type when that is the best available information.c.x now show where the attribute's type was narrowed instead of unrelated first-use info.python.analysis.autoImportCompletions setting, skipping auto-imports when disabled.func(foo=1, ba|)), and statement keywords like try/while are no longer offered in expression contexts.typing.List) are now ranked below their collections.abc equivalents in auto-import completions.bazel-check command adds Bazel-focused type-checking for projects that provide source information through JSON manifests. It is intended to collaborate with an in-progress rules_pyrefly Bazel rule implementation.nn.Module.__call__ type-check like the module's forward method.SizeTuple is now the public way to write shape parameters, with support for compact syntax like ndarray[[2, 3], dtype] and unpacking with *Elements[SizeTuple].SizeTuple, making it easier to model APIs involving multiple tensors with different shapes.SymVar, written as N: SymVar in PEP 695 syntax. Shape arithmetic is now limited to these symbolic shape variables.We closed 26 bug reports this release 👏
isinstance(value, type) narrowing for type[int] | str unions, which previously collapsed to bare type instead of preserving type[int].isinstance(value, type) narrowing for TypeForm[object], which previously produced type & TypeForm[object] instead of the correct type[int] after an issubclass check.isinstance(cls, type) and issubclass(cls, upper_bound) checks erasing TypeVar information, so type[F] is preserved through assertion chains instead of widening to the bound.no-any-return error kinds to detect returning Any from functions declared to return concrete types, with explicit and implicit variants and support for migrating mypy's warn_return_any setting.pyrefly coverage check --strict incorrectly labeling fully-Any symbols (e.g., def f(x: Any) -> Any) as coverage-partial instead of coverage-missing.pytorch-efficiency-lints not recognizing Tensor in common stub layouts.tuple(xs) losing track of tuple length when xs is already a tuple, now preserving known shapes like tuple[int, int] instead of widening to tuple[int, ...].__class__.__setattr__ on a class object, caused by missing metaclass handling.TypeVarTuple arguments like tuple[int, *Ts] not being assignable to varargs type tuple[int, *Ts] due to an internal mismatch in how Pyrefly represented the tuple types.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.
pip install --upgrade pyrefly==1.2.0-dev.2
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-errorspyrefly check --remove-unused-ignoresThis will add # pyrefly: ignore comments to your code, enabling you to silence errors and return to them later. This can make the process of upgrading a large codebase much more manageable.
Read more about error suppressions in the Pyrefly documentation.
@stroxler, @grievejia, @shobhitmehro, @asukaminato0721, @jorenham, @kinto0, @yangdanny97, David Tolnay, @ericzhonghou, @connernilsen, @qnox, @mikeleppane, @dillydill123, @arthaud, @alexander-beedie, @NathanTempest, @fhoehle, @WilliamK112, @xaskii, @durvesh1992, @lennardwalter, @kz357, @nitishagar
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
> Dev releases (versions like X.Y.Z-dev.N) are non-stable snapshots cut periodically from trunk. They give early adopters a chance to try in-progress
Release date: July 1, 2026
About dev releases Dev releases (versions like
X.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.2.0-dev.1 bundles 235 commits from 38 contributors.
@attr.s, @define, @frozen, and their variants, handling field specifiers (attr.ib(), field()), converters, validators, defaults, and private-field aliasing. See the new attrs documentation for details.isinstance narrowing now consumes dynamic uncertainty before intersecting with the target type, so x: Any narrowed by isinstance(x, C) refines to C instead of preserving the Any. This closes a type-safety hole while sacrificing the gradual guarantee in exchange for more precise runtime-evidence-based narrowing..get() and .pop() methods with literal defaults now preserve the field type when the default is assignable to it, so .get("x", "b") on a Literal["a", "b"] field returns Literal["a", "b"] instead of Literal["a", "b"] | str.SymbolInformation list with dotted container names.with ... as and except ... as, so those variables are syntax-highlighted consistently with other local bindings..thrift) now navigates directly to the symbol definition via text search instead of the top of the file, and works for nested attribute/enum member access.# type: ignore comments that suppress no errors, helping clean up stale suppressions (off by default; enable with unused-type-ignore = "error" in pyrefly.toml).(...) when emitted, preventing IndentationError in the generated stubs.Callable[..., Incomplete] instead of bare Incomplete, preserving callability information.ClassVar[...] in emitted stubs, correctly distinguishing them from instance attributes.__all__ is now preserved verbatim when it's a static list/tuple literal, so re-exports survive in the stub.def with AsyncGenerator return annotations instead of async def, following the typeshed convention and fixing coroutine-vs-generator confusion.pyrefly-shape-extensions and pyrefly-torch-stubs packages are now published to PyPI alongside Pyrefly releases, providing runtime helpers and shape-aware PyTorch stubs for tensor shape type checking.D[N] or D(N) runtime wrappers for dimension expressions, allowing evaluated annotations to survive Python runtime while preserving symbolic arithmetic.assert_shape runtime helper validates tensor shapes at runtime, falling back to rank-only checks for symbolic shapes.We closed 20 bug issues this release 👏
isinstance narrowing silently stopped working after a sibling branch in the same if/elif/else chain narrowed a different variable and terminated. The lazy-builtins optimization incorrectly lifted isinstance into the fork base, producing a degenerate Phi that resolved to Never and broke downstream narrowing.self: annotations reference the protocol itself. A new per-thread cycle guard prevents infinite recursion during overload filtering.Z: tuple[str, int]) now preserves positional element types instead of collapsing to a union. u, v = x where x: Z now reveals u: str, v: int instead of u: int | str, v: int | str..get(key, "literal") on a non-required key now returns the field type when the literal default is assignable to it, instead of widening to field_type | str.@no_type_check no longer emit unannotated-return diagnostics, since the decorator explicitly opts the function out of type checking."self" are no longer incorrectly flagged with bad-keyword-argument and bad-argument-type on construction. The instance receiver is now named __dataclass_self__ when a field named self exists.kw_only=True now correctly apply the keyword-only constraint to subclass fields, fixing false "field without default may not follow field with default" errors.match f(x):) now carry direct fallthrough narrows across cases, and the final capture forwards to the already-evaluated subject narrowed by previous cases.py.typed marker no longer trigger untyped-import recommendations, even when imported as submodules.typings/ directory under the config root is now auto-discovered on the CLI path (not just in the IDE), fixing a divergence where CLI and IDE had different stub search paths for the same config.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.
pip install --upgrade pyrefly==1.2.0-dev.1
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-errorspyrefly check --remove-unused-ignoresThis 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.
@stroxler, @shobhitmehro, @yangdanny97, @jorenham, @grievejia, generatedunixname2066905484085733, @connernilsen, @asukaminato0721, @samwgoldman, generatedunixname949130641157030, @kinto0, @NathanTempest, @ericzhonghou, @rchen152, @javabster, @QEDady, @mikeleppane, @markselby9, @aodihis, @arthaud, @DibbayajyotiRoy, Myles Matz, @ndmitchell, David Tolnay, @Kartikey077, pratved64, @maggiemoss, @goutamadwant, @kz357, @nitishagar, @hrolfurgylfa, @olekuhlmann, @JakobDegen, @lesbass, @fangyi-zhou, @ibraheemshaikh5, @alexander-beedie, @xaskii
Please note: These release notes summarize major updates and features. For brevity, not all individual commits are listed.
Pyrefly v1.1.1 is a patch release with a single bug fix.
Release date: June 18, 2026
Pyrefly v1.1.1 is a patch release with a single bug fix.
isinstance() narrowing of a union variable silently stopped working when an earlier sibling branch in the same if/elif/else chain narrowed a different variable with isinstance() and returned. The later narrowing left the union untouched, producing false missing-attribute errors on code that checked correctly in 1.0.0.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.
pip install --upgrade pyrefly==1.1.1
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-errorspyrefly check --remove-unused-ignoresThis 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.
One column per month.