Edition compiled at 07.40 NL EN FR
← Tech · Programming languages
Tech · Programming languagesPython

Out of beta, Astral now recommends its Rust-built type checker ty for production, and at OpenAI it ran a median 24 times faster

The makers of uv and Ruff pitch ty 1.0 as an alternative to mypy and Pyright, with fewer false alarms and built-in knowledge of Pydantic, Django and pytest.

· latest source update di · 3 sources · Astral, LavX News, App Developer Magazine · Compiled with AI
Illustration for this article

Astral, the company behind the Python package manager uv and the linter Ruff, on Tuesday released version 1.0 of ty, a type checker and language server for Python written in Rust. Until now ty was a beta; Astral now recommends it for production use by all users, the company writes on its blog. At OpenAI, ty is the default type checker for many millions of lines of Python. The switch there brought a median 24-fold speed-up and 73 percent less peak memory, according to Astral, as LavX News also reports.

In Astral's own measurements on an M3 Max, ty was fastest on 16 of 18 well-known open source projects, on average 1.46 times faster than Pyrefly and 3.56 times faster than Zuban, two other Rust-based checkers. In the editor, the language server responded fastest after an edit on 14 of 17 projects. On the official Python typing conformance suite, false positives fell from 224 in the beta to 14, and missed errors from 405 to 13. Mypy scores 190 and 109 on that suite, Astral says.

New in 1.0 are a rewritten solver for generic types, built-in support for Pydantic, Django, pytest and attrs, suggested fixes that `ty check --fix` applies automatically, and baselines to temporarily ignore existing diagnostics during a migration. PyPI downloads rose in a year from 1.7 to 49.6 million a month, and projects such as FastAPI and tox already use ty. App Developer Magazine picked the release as its app of the day.

Spotted a mistake in this article? Let us know.