I’m choosing a type checker to use alongside Ruff. For a typical Python project, is Ty enough, or does Pyrefly offer something that makes the extra setup worthwhile?
Ruff with Ty or Pyrefly for type checking?
Answers
Check the maturity and compatibility you need before choosing. The discussion describes Ty as an early, fast-moving tool whose behavior and diagnostics may change between releases. That can be fine for experiments or a team willing to update its setup, but it may be a poor fit if you need a stable CI check.
Pyrefly has reached a more stable release stage, which may matter more than speed for a production pipeline. Neither label settles which checker will work better on your code, so try both on a representative part of the project.
Reply to this answer
For a smaller or fairly ordinary codebase, I’d start with the simpler stack and only add complexity when a concrete gap shows up. If Ty catches the kinds of mistakes your team cares about and fits your editor and CI workflow, that may be enough.
One caveat raised in the discussion is support for Pydantic. If your project relies heavily on it, check how each tool handles your models before committing. A limitation there could matter more than general speed.
Reply to this answer
If you want the more established option, consider mypy or Pyright-based tooling too. People disagree about mypy: some find its performance and diagnostics frustrating, while others are comfortable with its behavior and prefer not to change a working setup.
So I wouldn’t switch just because a newer checker is getting attention. Compare the errors on your own code, including any framework-heavy areas, and weigh that against the stability and maintenance expectations of your team.
Reply to this answer
Pyrefly may be worth a look if its behavior fits your project and you want a checker with a stable release. One discussion mentioned using different checkers for internal code and public-facing APIs, but that’s a workflow choice, not a requirement. Running multiple checkers can also mean more configuration and more diagnostics to maintain.
Reply to this answer
There isn’t a universal winner here. The tools may differ in framework support, diagnostics, and the sort of type-checking behavior they offer, so “fast” or “stable” alone won’t tell you which is better for your codebase.
Pick a small but representative sample, run each checker with the same expectations, and look at false alarms, missed problems, setup effort, and CI behavior. If your current checker already works, you’ll need a specific benefit to make switching worthwhile.
v9!Brogue:
Would you include editor support in that comparison, or mainly focus on CI results?
6J!Cabbage:
Both. A clean CI result matters, but a checker that gives useful feedback in the editor can make day-to-day work much smoother.
Reply to this answer
Add your answer
Answers are reviewed before publication.
7K~Turnlet:
That sounds like the key test for me. I’ll try it on the parts of the project with the most Pydantic models first.