Pyrefly v0.51.0
Status : BETA
Release date: 02 February 2026
Pyrefly v0.51.0 bundles 162 commits from 25 contributors.
✨ New & Improved
| Area | What’s new |
| :---- | :---- |
| Type Checking | - Fixes for incorrect type narrowing in boolean operations with generic functions
- Intersection logic fixed to identify empty intersections (Never) for final classes and populated Enums, as they cannot be subclassed.
- Added support GenericAlias type, including special attributes like __origin__, __args__, and support for the pipe operator
- Added support for checking that class-scoped type variables are not used in self annotations in __init__ methods, per typing spec |
| Language server | - During module resolution, "phantom paths" (non-existent paths checked during import) are now tracked, improving watch mode and import re-resolution
- List addition () now propagates type hints to both operands, making assignments like work as expected |
| | - Added configuration to debug and/or bypass deep recursion, which is useful for diagnosing stack overflow issues in large or generated codebases - Multiple error messages have been shortened, clarified, or made more precise for better user experience (e.g., TypedDict, protocol variables, unpacking errors, pydantic, descriptor defaults). |
| | - Faster suggested standard library imports (did you mean...?) - Reduced memory usage for type aliases of unions - Further improvements to tracking for fine-grained dependencies, improving IDE performance during incremental rechecks and accuracy of features like auto-imports |