NewsCrawler.org

Astral releases ty 1.0, a fast Python type checker and language server

Astral releases ty 1.0, a fast Python type checker and language server
Image: astral.sh

Astral has released version 1.0 of ty, an extremely fast Python type checker and language server[1] written in Rust, which it presents as an alternative to mypy, Pyright and Pyrefly. ty is now the default and most widely used type checker at OpenAI, where migrating to it resulted in a median 24x speedup and a 73% reduction in peak memory usage. Astral says it is ready to recommend ty for production use for all users.

In Astral's benchmarks, ty was the fastest type checker on 16 of 18 ecosystem projects, 1.46x faster than Pyrefly and 3.56x faster than Zuban by geometric mean. On the Python typing conformance suite, ty records 14 false positives[2] and 13 false negatives[3], down from 224 and 405 at the Beta release, while mypy records 190 and 109. The 1.0 release adds opt-in return type inference for functions without return annotations, lets users apply fixes with ty check --fix, and supports a diagnostic baseline for recording existing errors.

Script checking for standalone Python scripts that declare their dependencies through inline metadata (PEP 723) is available in preview through the uv integration and can be enabled with project-manager.script = "uv". ty is stricter in some places and more permissive in others, for example when narrowing types after isinstance. Astral says it can now start exploring broader uses of ty, such as type-aware linting, dead-code elimination and type-aware test selection.

Repository ty github.com

A fast Python type checker and language server written in Rust, by Astral, offered as an alternative to mypy and Pyright.

Stars: 20,000Forks: 350License: MITUpdated:

Read the original astral.shDiscussion

Discussion

Commenters mostly welcome the release and say ty has been reliable for a while, though one reports more crashes in recent versions. Several still run mypy alongside ty, and one says ty's Django support is still early, without reverse relations or django-stubs. Others compare ty with Pyrefly and basedpyright, and one asks whether OpenAI's ownership of Astral concentrates the Python and TypeScript ecosystems.

Primary sources and details

Sources

Published: First seen: Читать по-русски

Open as a page