· AI dev tools

ty 1.0 release, fast Rust Python type checker, language server for production use

The process of type checking code just got a significant boost for Python developers with the stable 1.0 release of ty, a language server and type checker from Astral.


This tool, which is written in Rust, positions itself as a high-speed alternative to established utilities such as mypy, Pyright, and Pyrefly.

Astral, the team behind this release, is known for crafting high-performance tools for the Python ecosystem, notably uv, their package manager, and Ruff, their linter and formatter. Internally at OpenAI, ty has become the standard and most widely used type checker, covering millions of lines of crucial Python code. The shift to ty within their organization yielded substantial performance gains, including a median 24x acceleration and a 73% decrease in peak memory consumption. The developers are now confident enough to endorse it for use in production environments for all users.

Performance was a core principle guiding the creation of ty, mirroring the focus on speed seen across the Astral toolchain. When running on the command line, the time required to type check a project without leveraging caching was measured on an M3 Max. In rigorous benchmarks, ty emerged as the fastest type checker across 16 out of 18 projects within the ecosystem. Specifically, its geometric mean speed surpassed Pyrefly by 1.46x and Zuban (which is also Rust-based) by 3.56x. A key element of ty's design is its reliance on "incrementality," a feature that facilitates extremely rapid live updates when operating within an editor or a long-running process; this incrementality is slated for future use in workflows extending beyond the editor itself.

Examining editor performance, ty proved to be the swiftest language server in 14 out of 17 ecosystem projects. In these editor tests, it was 7.73x faster than Pyrefly and 3.22x faster than Zuban. Despite being in Beta status for several months, ty has seen rapid adoption, integrating into widely utilized projects such as FastAPI and tox. Data from PyPI's public dataset shows that in October 2025 and October 2026, distribution file downloads were tracked. Furthermore, an audit conducted in November on the 25,000 most frequently downloaded PyPI packages revealed that 11.6% of repositories utilizing a type checker were employing ty, ranking third behind mypy and Pyright. Looking only at repositories established within the past year, ty was used by 22.6% of them, compared to 26.0% for Pyright and 62.9% for mypy.

Ty employs a novel method for Python typing, grounding itself in gradual and set-theoretic typing. The team believes this foundational approach allows them to develop something greater than merely a "faster type checker"; their ambition is to create a superior type checker capable of evolving alongside Python’s own type system. On the Python typing conformance suite, which serves as an imperfect stand-in for real-world correctness, ty now logs only 14 false positives and 13 false negatives, a marked improvement from the 224 and 405 recorded during the Beta phase. For context, mypy reported 190 false positives and 109 false negatives.

The 1.0 release brings substantial enhancements to the core type checking capabilities, introducing a new generics solver and support for comprehensive bidirectional inference. In a test involving eight type checkers, only ty successfully identified and accepted a function after the misspelled key below was corrected. The example demonstrated that ty suggests replacing "second" with "seconds" when the `Runner` TypedDict defines a field named `seconds`, and the sort key uses the incorrect spelling "second." This instance shows ty’s ability to infer that Ada’s dictionary conforms to the `Runner` type, carrying that type into the sort key where the error is caught and suggested.

A more complex demonstration involves `satisfies_all`, which combines multiple predicates. Ty correctly infers that `valid_batch` requires an input that is both `Sized` and yields integers, accepting `[1, 2, 3]` while rejecting `iter([1, 2, 3])`. The error message correctly points out that the first predicate necessitates a value with a length, while the second requires a value yielding integers. Mypy infers `Never` for the input of the conjoined predicates and rejects both inputs, whereas Pyright infers `Sized` from `large_enough` and flags the call to `satisfies_all`. Pyrefly infers `Sized | Iterable[int]` and permits the iterator, which results in a runtime failure.

With this 1.0 update, ty also incorporates native support for foundational Python libraries, including Pydantic, Django, pytest, and attrs. An example using Pydantic shows how ty handles various constructor inputs for the `Options` model. Ty accepts the path string that Pydantic transforms into a `Path` object, but it flags the string provided to the strict boolean field and warns about `simulate=True` because the constructor is expecting `dry_run` for that specific field.

Furthermore, ty has introduced opt-in return type inference for functions that lack explicit return annotations. In a scenario involving a `decode` function, ty tracks the check that a log record possesses an `id` before it is returned. By enabling return type inference, ty follows this `id` check, ensuring it holds on every successful return. The inferred return type becomes `LogRecord` with an `id` attribute of type `object`.

The diagnostic system in ty is highlighted for its ability to link a warning back to its originating cause, even if the issue spans across different files, and to propose a remedy. An example involving `quiz.py` illustrates this: because the annotation `scores: tuple[int]` implies exactly one score, the check is always true, and the branch for an empty tuple is unreachable. Ty issues a `warning[redundant-condition]` because a 1-element tuple is always truthy, suggesting the use of `tuple[int, ...]` to allow for empty tuples. This diagnostic traces the unreachable `return None` back to the annotation.

In the 1.0 release, the tool also supports automating these fixes via `ty check --fix`. For instance, in `span.py`, ty identifies a redundant cast because both endpoints are integers. The command `ty check --fix` removes the cast and preserves the order of operations by keeping the parentheses around the sum, resolving the diagnostic.

When developers are migrating established projects, ty now offers ways to manage existing errors. They can use `ty check --add-ignore` to insert suppression comments in a single pass, or they can establish a diagnostic baseline using `ty check --update-baseline`. Once this baseline file is committed, CI pipelines can flag only new errors while developers work incrementally to address the pre-existing diagnostics.

In the context of script support, ty integrates with uv to check standalone Python scripts. This integration allows these scripts to declare their necessary dependencies and Python requirements through inline metadata, adhering to PEP 723. By connecting with uv, ty can automatically establish a dedicated environment for every such script.

Why it matters

For developers seeking high-performance tooling, ty offers a significant speed and memory improvement over existing options like mypy and Pyright. Its advanced type inference capabilities suggest a shift toward more robust and accurate static analysis in the Python ecosystem.

Earlier coverage

Related coverage

Also worth reading

  1. next.js 16.6.0-canary.4 released, adding Go syntax highlighting and Node.js 24 unit tests
  2. TypeScript 7.1-rc released for developers to download on npm
  3. next.js 16.6.0-canary.2 released, adds file uploads, updates docs, and more
  4. next.js 16.6.0-canary.1 released with 405 for forbidden Route Handler methods
  5. Angular 21.2.27 released, fixes component template capture during compile