Ty 1.0: an extremely fast Python type checker and language server astral.sh · 11...

@best

Ty 1.0: an extremely fast Python type checker and language server astral.sh · 117 points · 22 comments · HN thread

TL;DR Astral announces ty 1.0, its Rust-based Python type checker and language server, recommending it for production use. The post cites a median 24x speedup and 73% lower peak memory after OpenAI migrated internal code to ty, plus benchmark wins over Pyrefly and Zuban and a large drop in conformance-suite errors since Beta.

  • ty is the fastest type checker on 16 of 18 ecosystem projects in Astral's benchmarks, 1.46x faster than Pyrefly and 3.56x faster than Zuban by geometric mean.
  • On the typing conformance suite, ty records 14 false positives and 13 false negatives, down from 224 and 405 at Beta; mypy reports 190 and 109.
  • 1.0 adds a generics solver, bidirectional inference, opt-in return type inference, and ty check --fix, --add-ignore and a baseline file for gradual adoption in CI.
  • Integration with uv for PEP 723 scripts is in preview and enabled via project-manager.script = "uv".
  • Narrowing after isinstance is relaxed by default, with opt-in strict generic narrowing for users who want more soundness.
  • Astral plans to use the incremental architecture for type-aware linting, dead-code elimination, and test selection.

Discussion The thread is mostly congratulatory, with several users saying they have used ty since the alpha and found it reliable. Practical questions dominate: Django and DRF support, how ty compares with Pyrefly now, and how to type dynamic kwargs dicts. A substantial side debate concerns OpenAI's acquisition of Astral, with some calling it a move to dominate the Python ecosystem and others saying it is premature to judge. The mood is positive overall with a skeptical undercurrent about corporate ownership.

  • Congratulations and praise for ty's reliability (many): Several commenters congratulate the team and say ty has been dependable since alpha, including as a replacement for pylsp. Some say they forgot it was pre-1.0 software.
  • OpenAI ownership of Astral is a concern (some): Commenters note that OpenAI owns Astral and that Microsoft owns Pyright, asking whether two companies dominate Python and TypeScript tooling. Others say big companies routinely build ecosystems and that acquisition has been a net negative for trust.
  • Pyrefly is preferred or being compared (some): Some users say Pyrefly is their preferred checker, and one switched from ty to Pyrefly recently. Others plan to re-compare ty 1.0 against Pyrefly on their own code.
  • Defends OpenAI-Astral move as not selling out (a few): Some argue that working for a company does not equal selling out, and that Astral's tools have kept improving. Others say only license changes or hostile behavior would show a sellout.
  • Python typing is less valued now (a few): One commenter says they now write fewer Python annotations and use Rust for projects needing strong types, with Python kept for glue code.
  • Typing dynamic kwargs needs TypedDict or Mapping (a few): A user found ty flagged hundreds of errors on a splatted kwargs dict. Maintainers say dynamic keys cannot be tracked precisely, and a commenter summarises the typing spec advice to use Mapping, TypedDict, or a plain dict annotation.

Links from the comments

#python #typeChecking #rust #astral #developerTools