ty 1.0: Rust Python Type Checker Is Production Ready

ty Python type checker 1.0 release from Astral

Astral has released ty 1.0, a Rust-built Python type checker and language server, and recommends it for production use by all users. ty is already OpenAI’s default and most widely deployed type checker, covering many millions of lines of critical Python.

The ty Python type checker is positioned as an alternative to mypy, Pyright and Pyrefly. OpenAI’s migration brought a median 24x speedup and a 73% cut in peak memory use. Install it with uv tool install ty@latest or through the VS Code extension.

Speed and adoption

The ty Python type checker is fast by design. Astral, the company behind the uv package manager and the Ruff linter and formatter, applied the same performance focus here. In its own tests ty finished first on 16 of 18 ecosystem projects, averaging 1.46x the speed of Pyrefly and 3.56x that of Zuban (geometric mean). As a language server it led on 14 of 17 projects, at 7.73x Pyrefly and 3.22x Zuban.

The architecture is built around incrementality, so live updates in an editor or long-lived process stay quick. Astral plans to use that for workflows beyond the editor.

Adoption grew during the Beta, including in FastAPI and tox. An audit in November covering the 25,000 most-downloaded PyPI packages put ty third among type checkers, behind mypy and Pyright, at 11.6% of repositories that use one. For repositories created within the last year the split was 62.9% mypy, 26.0% Pyright and 22.6% ty.

Fewer false results

ty takes an approach based on gradual and set-theoretic typing, and Astral says the goal is a better checker as well as a faster one. Astral points to the Python typing conformance suite, an imperfect stand-in for real-world correctness: ty now logs 14 false positives and 13 false negatives, down from 224 and 405 at Beta. mypy logs 190 and 109.

The release adds a generics solver and extensive bidirectional inference. In one example, a function called satisfies_all combines any number of predicates. ty infers that the batch input needs a length and integer items, accepting a list and rejecting an iterator. mypy infers Never and rejects both calls, Pyright infers Sized and flags the call, and Pyrefly accepts the iterator, which fails at runtime.

Also new is optional return-type inference for functions that lack return annotations. With it on, ty carries the knowledge that a log record has an id to the caller, while Pyright, Pyrefly and Zuban flag the access and mypy infers Any.

Diagnostics and migration tools

A ty diagnostic can link a warning to its cause across files and suggest a fix. Version 1.0 can apply fixes with ty check –fix. For existing projects, ty check –add-ignore adds suppression comments in a single sweep. A different route is a diagnostic baseline, recorded with ty check –update-baseline. Commit the baseline file and CI flags only new errors while old ones are fixed over time.

Scripts, strictness and soundness

Integration with uv lets ty check standalone scripts that declare dependencies through inline metadata (PEP 723). It prepares a separate environment per script, so a project and its scripts can be checked together even with different Python versions or conflicting dependencies. This is in preview and can be enabled with project-manager.script = “uv”.

ty is stricter in places. It works out sharper types for unannotated containers and attributes, so it catches errors even in lightly typed code. It is looser elsewhere: narrowing after isinstance checks now needs fewer casts and annotations. For users who want maximum soundness, opt-in settings such as strict generic narrowing go beyond what other checkers support, and ty can also flag functions that return Any, including partial-Any cases that mypy’s warn-return-any misses.

What comes next

For the ty Python type checker, Astral says its priority is helping users adopt ty. With the core finished, it plans to look at type-aware linting, dead-code removal, unused-dependency analysis and test selection driven by types. The company says ty will keep improving every week, as Ruff and uv have, by working closely with users.

Source: astral.sh

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.