Comparison of the Two New Typecheckers

Comparison of the Two New Typecheckers

May 28, 2025

At PyCon 2025’s Typing Summit, participants were given a first look at Meta’s Pyrefly and Astral’s ty, two new Python type checkers that promise dramatically faster, more powerful type analysis.

Edward Li helpfully took notes and provided a right-up.

Here are some takeaways:

  • Both tools are blazingly fast

    • Pyrefly claims up to 1.8 million lines/sec (35× faster than Pyre, 14× faster than MyPy/Pyright), while ty benchmarks show it running 2–3× faster than Pyrefly on real-world codebases.
  • The tools have distinct philosophies

    • Pyrefly pushes aggressive inference, e.g. revealing concrete unions even without annotations and catching subtle errors like None * 2.
    • ty follows the gradual guarantee, treating unknown types more permissively, so type checking never adds errors to working code.

Warning

Both tools are still finding their in alpha release and will undergo rapid evolution and feature convergence in the months ahead.

For anyone invested in Python’s type-checking future, this head-to-head is a must-read. Dive into Edward’s full notes, benchmarks, and examples on his blog.

Last updated on

Please submit corrections and feedback...