Ruff author contrasts type inference: ty vs Mypy vs Pyright vs Pyrefly on one example
charliermarsh · x · 2026-12-02
Charlie Marsh (Ruff/Astral) uses an example from the ty 1.0 blog post to compare Python type checkers. satisfiesall conjoins an arbitrary number of predicates; ty infers validbatch needs an input that has a length and yields integers, accepting [1,2,3] but rejecting iter([1,2,3]). Meanwhile Mypy infers Never and rejects both calls, Pyright infers Sized and flags the call, and Pyrefly infers Sized | Iterable[int], accepting an iterator that fails at runtime — a clear showcase of diverging inference behavior across the four tools.
More from coding & agent
- Spawn founder: naming each agent stops Claudes from rubber-stamping each other's bad work — TAbrodi · 2026-12-02
- Nano 2.1 vs GPT Img 2.6 compared: Fable + Three.js + Seedream pipeline for controllable renders — Ror_Fly · 2026-12-02
- One prompt, full autonomous run: agent finds a trend, makes song and video in 2h41m — tetsuoai · 2026-12-02
- YouTube explainer breaks down how MCP actually works — S20091981 · 2026-12-02
- ty 1.0 demo: satisfies_all infers length-plus-integer constraints across predicates — charliermarsh · 2026-12-02
- Danny Postma launches a landing-page course your coding agent takes with you — doooyle · 2026-12-02