Pyrefly and ty: Two New Rust-Based Python Type Checkers Emerge

2025-05-27

At PyCon 2025, Meta's Pyrefly and Astral's ty, two new Rust-based Python type checkers, made their debut. Pyrefly aims to be faster, more portable, and more capable than its predecessor, while actively engaging with the open-source community. ty emphasizes a "gradual guarantee," meaning removing type annotations shouldn't cause type errors. Both leverage Ruff for AST parsing and offer command-line and IDE integration. Benchmarks showed ty generally faster, but they differ in type inference and error handling. Pyrefly is more aggressive, potentially catching more errors but also introducing more false positives; ty is more conservative, prioritizing code compatibility. Both are in early alpha, and their future evolution is exciting to watch.

Development Type Checker