github facebook/pyrefly 0.29.0
Pyrefly v0.29.0

latest releases: 0.31.0, 0.30.0, 0.29.2...
17 days ago

Status : ALPHA
Release date: 18 August 2025

Pyrefly 0.29 bundles 192 commits from 23 contributors. This release focuses on improving the type checker's behavior, particularly around handling Any and LiteralString, enhancing LSP features like "go to definition" and hover, and various internal refactors for maintainability.

✨ New & Improved

Area What’s new
Type Checker Behavior - The type checker now treats return outside of a function, and await, async for, async with outside of async function definitions as syntax errors.
- Support special LiteralString behavior for methods like str.join and str.format.
- Any handling for super().__init__ and super().__new__ calls have been improved.
- typing.Self is now correctly substituted inside method bodies.
- Using the new PEP 728 keywords (closed, extra_items) in TypedDict no longer throws type errors.
- Full support for PEP 728 is coming soon.
LSP Features - "Go to definition" now prioritizes .py files over .pyi for a more useful real implementation view.
- Docstrings now appear for standard library functions.
- Display ranges for generator expressions have been adjusted for consistency with Python AST.

🐛 Bug fixes

We closed 21 bug issues this release 👏

  • #940 - cannot use items as a key in a TypedDict
  • #915 - incorrect autocomplete suggestions for read_database
  • #872 - false positive inside while loops
  • #853 - excessive memory usage in VScode due to multiple processes being spawned
  • Too many panics, not enough discos:
    • #864 - panic for helion with pytorch installed
    • #848 - panic key lacking binding
  • Other bug fixes: #931, #833, #815, #748, #725, #655, #906, #905, #901, #895, #894, #891, #889, #931, #922

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

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:

1. pyrefly check --suppress-errors
2. run your code formatter of choice
3. pyrefly check --remove-unused-ignores
4. 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](https://pyrefly.org/en/docs/error-suppressions/)

🖊️ Contributors this release

Aahan Aggarwal, Abby Mitchell, Conner Nilsen, Danny Yang, David Luo, Fangyi Zhou, James Gill, Kc Balusu, Kyle Into, LyricalToxic, Maggie Moss, Maxime Arthaud, Neil Mitchell, Rebecca Chen, Rubmary Rojas, Sam Goldman, Sam Zhou, Steven Troxler, Vladimir Matveev, Xavi Simpson, Zach Riser, Zeina Migeed

Don't miss a new pyrefly release

NewReleases is sending notifications on new releases.