Status : ALPHA
Release date: 25 August 2025
pyrefly v0.30.0 bundles 195 commits from 20 contributors π
β¨ New & Improved
Area | Whatβs new |
---|---|
Completions | - Enhanced completions for super with multiple inheritance implemented completion for unions - When the attribute base is a union, suggestions are now combined from every branch of the union. This might lead to errors, but it's more helpful to make the suggestion |
Type System | - added a configuration flag to turn off "infer from first use" behavior. Inferring types from first usage is valuable for catching bugs but it can lead to false positives so this new flag allows users to turn it off. Turning it off behaves like pyright, leaving it on behaves like mypy. - implicit attribute definition errors are now turned off by default. These errors were raised when an attribute is only declared in a non-constructor method, but it can be a source of false positives in dynamic code. - When type args are not explicitly set, push the class type params into methods (matches mypy approach, differs from pyright that implicitly instantiates with Any /default) ensured qualified names are printed for enums as part of unions. - Enable creation of empty enums and named tuples using functional syntax Default excludes now align with Pylance (incl. Node_modules , __pycache__ and *venv )
|
π Bug fixes
We closed 11 bug issues this release π
- #984 - empty enums incorrectly given type
Never
, rather thanAny
- #865 - completion not working for Pytorch
torch.zeros
module - #514 - issue returning generic
Self
- Other bug fixes: #971, #967, #743, #567, #348, #261, #186, #103
Thank-you to all our contributors who found these bugs and reported them! Did you know this is one of the most helpful contributions you can make to an open-source project? If you find any bugs in Pyrefly we want to know about them! Please open a bug report issue here
π¦ Upgrade
pip install --upgrade pyrefly==0.30
How to safely upgrade your codebase
Upgrading the version of Pyrefly you're using or a third-party library you depend on can reveal new type errors in your code. Fixing them all at once is often unrealistic. We've written scripts to help you temporarily silence them. After upgrading, follow these steps:
pyrefly check --suppress-errors
- run your code formatter of choice
pyrefly check --remove-unused-ignores
- Repeat until you achieve a clean formatting run and a clean type check.
This will add # pyrefly: ignore
comments to your code, enabling you to silence errors and return to fix them later. This can make the process of upgrading a large codebase much more manageable.
Read more about error suppressions in the Pyefly documentation
ποΈ Contributors this release
@javabster, @capickett, Carlos Fernandez, @connernilsen , @yangdanny97, @grievejia, @kinto0, @arthaud, @prasannavenkateshgit, @rchen152, @rchiodo, @rubmary, @samwgoldman, @SamChou19815, @sargun, @stroxler, @VladimirMakaev, @migeed-z, @LycheeBay