AIFeed

ty 1.0: an extremely fast Python type checker and language server

Original text(via Lobsters)

December 1, 2026

ty 1.0

TL;DR: ty is an extremely fast Python type checker and language server, written in Rust, and designed as an alternative to tools like mypy, Pyright, and Pyrefly.

Today, we're announcing the 1.0 release of ty.

ty is now the default and most widely-deployed type checker at OpenAI, providing coverage for many millions of lines of critical Python. Internally, migrating to ty resulted in a median 24x speedup and 73% reduction in peak memory usage.

We’re ready to recommend it for production use, for all users.

At Astral, we build high-performance developer tools for the Python ecosystem. We're best known for uv, our Python package manager, and Ruff, our linter and formatter.

Today, we're announcing the 1.0 release of ty, an extremely fast Python type checker and language server, written in Rust.

You can install ty today with uv tool install ty@latest, or via our VS Code extension.

Type checking performance

Like the rest of the Astral toolchain, ty was built with an obsessive focus on performance.

Cold checks for FastAPI, pandas, PyTorch, and Home Assistant. ty was fastest on FastAPI, pandas, and Home Assistant. Pyrefly was fastest on PyTorch.
Cold checks for FastAPI, pandas, PyTorch, and Home Assistant. ty was fastest on FastAPI, pandas, and Home Assistant. Pyrefly was fastest on PyTorch.

In our benchmarks, ty was the fastest type checker on 16 out of 18 ecosystem projects: 1.46x faster than Pyrefly and 3.56x faster than Zuban (both written in Rust), by geometric mean.

ty’s architecture is built around "incrementality", which makes live updates extremely fast in the context of an editor or long-lived process. (In the future, we plan to leverage this incrementality to power workflows beyond the editor.)

Diagnostics after an edit for FastAPI, pandas, PyTorch, and Home Assistant. ty was fastest on all four among the checkers that returned a result.
Diagnostics after an edit for FastAPI, pandas, PyTorch, and Home Assistant. ty was fastest on all four among the checkers that returned a result.

In our editor benchmarks, ty was the fastest language server on 14 out of 17 ecosystem projects (7.73x faster than Pyrefly, and 3.22x faster than Zuban).

Type checker adoption

ty has grown rapidly over the past few months (despite its Beta status), with adoption in widely used projects like FastAPI and tox.

ty’s PyPI downloads grew 29x between October 2025 and October 2026

Downloads in October 2025 and October 2026. Mypy grew from 55.2M to 198.7M, the Pyright Python wrapper from 14.4M to 50.2M, ty from 1.7M to 49.6M, Pyrefly from 394K to 10.1M, and Zuban from 13,911 to 258,082. Open dots mark 2025 and filled dots mark 2026.
Downloads in October 2025 and October 2026. Mypy grew from 55.2M to 198.7M, the Pyright Python wrapper from 14.4M to 50.2M, ty from 1.7M to 49.6M, Pyrefly from 394K to 10.1M, and Zuban from 13,911 to 258,082. Open dots mark 2025 and filled dots mark 2026.

In a November audit of the 25,000 most-downloaded PyPI packages, 11.6% of repositories with a type checker used ty, placing it third behind mypy and Pyright. Among those repositories created in the last year, 22.6% used ty, 26.0% used Pyright, and 62.9% used mypy.

Type checking in practice

ty takes a novel approach to Python typing based on gradual and set-theoretic typing. It’s our belief that this foundation will enable us to build more than a “faster type checker.” We want to build a better type checker, and one that can co-evolve with Python’s type system.

On the Python typing conformance suite, an imperfect proxy for real-world correctness, ty now records just 14 false positives and 13 false negatives, down from 224 and 405 at the Beta release. (For comparison, mypy reports 190 false positives and 109 false negatives.)

Inferring types from context

The 1.0 release includes extensive improvements to core type checking, including a novel generics solver and support for extensive bidirectional inference. Of the eight type checkers we tested, only ty both reported the misspelled key below and accepted the function after we corrected it.

For a more extreme example, consider satisfies_all, which conjoins an arbitrary number of predicates. ty infers that valid_batch needs an input that has a length and yields integers, accepting [1, 2, 3] and rejecting iter([1, 2, 3]).

Mypy infers Never for the conjoined predicates’ input and rejects both calls. Pyright infers Sized from large_enough and flags the call to satisfies_all. Pyrefly infers Sized | Iterable[int] and accepts the iterator, which fails at runtime.

Pydantic support

With the 1.0 release, ty now includes built-in support for foundational Python libraries like Pydantic, Django, pytest, and attrs.

Return type inference

We’ve also added opt-in return type inference for functions without return annotations. In the example below, decode checks that a log record has an id before returning it. ty carries that information to the caller, so it accepts record.id.

With return type inference enabled, Pyright, Pyrefly, and Zuban infer LogRecord and flag the access to record.id. Mypy infers Any.

Diagnostic system

In the Beta announcement, we highlighted our best-in-class diagnostic system and editor integrations. A single ty diagnostic can connect a warning to its cause, even across files, and suggest a fix.

In 1.0, we also support applying those fixes automatically via ty check --fix.

Migration support

When migrating an existing project, you can now run ty check --add-ignore to add suppression comments in one pass.

Alternatively, configure a diagnostic baseline and run ty check --update-baseline to record existing diagnostics in a separate file. Commit that file, and CI can flag new errors while you fix existing diagnostics over time.

Script support

In our uv and ty integration announcement, we introduced support for type checking standalone Python scripts that declare their dependencies and Python requirements through inline metadata (PEP 723).

By integrating with uv, ty can automatically prepare a separate environment for each script, allowing you to check an entire project and its scripts together, even when they require different Python versions or conflicting dependencies. The same integration powers completions, code navigation, and diagnostics in your editor.

With the 1.0 release, this integration is available in preview and can now be enabled directly in your ty configuration with project-manager.script = "uv".

Gradual typing in practice

Finally, we’ve made ty stricter in some places and more permissive in others.

For example, ty now infers more precise types for containers and attributes without annotations, enabling it to catch errors even in lightly typed code.

We've also relaxed some of the rules for narrowing types after checks like isinstance, so common Python patterns need fewer casts or annotations.

In the example below, the parameter is annotated as Term | list[Term]. After isinstance(terms, list), we’d usually expect each item to be a Term. But a subclass of Term could also inherit from list[str], so the list could contain strings. ty now accepts term.text by default and flags the access when strict generic narrowing is enabled.

These changes were informed by iterating with users and reviewing real projects in the ecosystem, balancing precision and usefulness with soundness. For users who want to prioritize soundness, ty offers opt-in settings like strict generic narrowing that often go beyond what other type checkers support.

Similarly, ty supports many of the type-enforcement rules popular in mypy’s strict mode, sometimes going further. For example, ty can warn when a function returns Any, including partially-Any cases that mypy’s warn-return-any misses:

What’s next

ty is the most technically ambitious project I have ever worked on. Our goal was to build something genuinely new: an architecture designed around fine-grained incrementality, a novel application of gradual and set-theoretic typing to Python, and a foundation for entirely new kinds of developer tools. I feel immense pride in the core team as we ship 1.0 (Alex, Andrew, Aria, Carl, David, Dhruv, Doug, Ibraheem, Jack, Lérè, Micha, and Shunsuke).

As in the Beta release, our immediate priority from here is supporting users as they adopt ty.

Now that we’ve built the core of our type checker, though, we can start exploring its broader applications: type-aware linting, dead-code elimination, unused dependency analysis, type-aware test selection, and more.

We want to make Python the most productive version of itself. And with ty, we can power an entirely new set of tools and capabilities for the language based on the most sophisticated Python type engine in the world.

Just as with Ruff and uv, our commitment from here is that ty will get significantly better every week by working closely with our users. Thank you for building with us.

The text above was extracted automatically from the source page and may miss images, tables or code blocks. The original is authoritative.

Published by Lobsters
This site only summarises and aggregates; copyright stays with the original author. Headlines and summaries follow the source — where they differ, the original wins.
Read the original ↗