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