Astral released ty 1.0 on December 1, 2026. ty is a Python type checker and language server written in Rust, from the team behind uv and Ruff. The announcement leads with two numbers. First, ty is now the default type checker at OpenAI, where migrating gave "a median 24x speedup and 73% reduction in peak memory usage." Second, in Astral's own benchmarks, ty was the fastest type checker on 16 of 18 open-source projects.
Adoption is growing from a smaller base. Astral says that in a November audit of the 25,000 most-downloaded PyPI packages, 11.6% of repositories with a type checker used ty, third behind mypy and Pyright. The Hacker News thread passed 600 points within a day, and many comments circled two questions: is it really that much faster than the checker people use today, and is it ready for real codebases?
This article answers both. The first half reads the benchmark files behind the headline numbers. The second half is a migration plan from mypy or Pyright, built from ty's own migration guide, with the config and commands you need.
One note on sources: everything below comes from Astral's announcement and docs, the published benchmark file, the Python typing conformance results, and the HN discussion. ty was not run for this article, so there are no hands-on timings here.
What shipped in 1.0
The short list, from the announcement:
- A stable release. Astral says it is "ready to recommend it for production use, for all users."
-
A new generics solver and bidirectional inference. ty uses the surrounding context, such as an expected type, to infer the type of an expression. In Astral's example, it works out that a sort-key lambda receives a
Runnerdictionary and catches a misspelled key inside it. - Built-in support for Pydantic, Django, pytest and attrs. ty has no plugin system like mypy's, so library support is built into the checker.
-
ty check --fixto apply suggested fixes automatically. -
Migration helpers:
ty check --add-ignoreand a diagnostic baseline file. Both are covered in the migration steps below. - Opt-in return type inference for functions without return annotations.
There is also an ownership point that came up in the thread. In March 2026, Astral announced an agreement to join OpenAI as part of the Codex team. The post says OpenAI will keep supporting the open source tools. ty itself is MIT licensed. One commenter asked whether it matters that OpenAI now owns Astral and Microsoft owns Pyright. That is a fair question to keep in mind when you pick a tool, but the MIT license means you can keep using ty, and even fork it, whatever happens to the company.
Reading the speed numbers
There are three different speed claims in the announcement. They measure different things.
Claim 1: "a median 24x speedup" at OpenAI
This is an internal number from one company's codebase. The post does not say which checker OpenAI moved away from or how the median was computed. Treat it as a signal that ty works at large scale, not as a figure you can expect for your own project.
Claim 2: "fastest on 16 out of 18 projects"
This one has a public source. The benchmark file lists every run. Four details matter when you read it.
The ty version is not 1.0. The file says the runs used ty 0.0.114, Pyrefly 1.5.0, Pyright 1.1.414, mypy 2.4.1 and Zuban 0.11.1. These are recent versions, but the ty binary you install today is a newer build.
The CLI runs are cold. The announcement labels the chart "without caching." mypy normally keeps a cache between runs (its docs call this incremental mode), so a second mypy run on an unchanged project can be much faster than the cold number. Cold runs are still the relevant number for a fresh CI machine without a restored cache.
The hardware is an Apple M3 Max with 128 GB of memory. Absolute times on your laptop or CI runner will differ, and the ratios between tools may shift.
The gap against Pyrefly is small. The gap against mypy and Pyright is large. A few examples from the file:
- pytest: ty 100.7 ms, Pyrefly 164.0 ms, Zuban 588.3 ms, mypy 2.330 s, Pyright 4.570 s.
- openai (the Python SDK): ty 182.8 ms, Pyrefly 296.1 ms, mypy 6.708 s, Pyright 8.155 s.
- sympy: Pyrefly 332.3 ms, ty 422.1 ms, mypy 6.659 s, Pyright 30.003 s. Here Pyrefly was 1.27x faster than ty.
- pytorch: Pyrefly was 1.17x faster than ty.
- django: ty and Pyrefly tied (1.00x). On sqlalchemy the gap was 1.01x.
So the two losses were PyTorch and SymPy, and two of the "wins" are within the measurement error. Against mypy, ty's cold-run lead ranged from about 8.6x (isort) to about 569x (numpy) across the projects. Against Pyrefly, it ranged from a tie to about 2.2x.
In plain terms: if you use mypy or Pyright today, ty or Pyrefly will likely feel like a big jump. If you already use Pyrefly, the speed gap is small enough that other factors should decide.
Pyrefly publishes its own speed claims too. Its README says it checks "over 1.85 million lines of code per second" and type checks PyTorch "15x faster than Mypy and Pyright." Each project publishes the benchmarks that favor its own tool. The useful habit is to run two candidates on your own project.
Claim 3: editor speed
The second chart measures how long each language server takes to update diagnostics after an edit. Astral reports ty fastest on 14 of 17 projects, "7.73x faster than Pyrefly, and 3.22x faster than Zuban." For daily editing, this is the number you feel. One HN commenter wrote that with Pyright, go-to-definition "is often slower than ripgrep search," and that ty's speed there surprised them.
Reading the correctness numbers
Speed is easy to measure. Correctness is harder.
Astral reports that on the Python typing conformance suite, ty now has 14 false positives and 13 false negatives, down from 224 and 405 at the Beta release. For comparison, the post says mypy has 190 false positives and 109 false negatives.
The public conformance results table, maintained in the python/typing repository, gives a second view. Counting its 146 test rows: Pyrefly 1.5.0 and Zuban 0.10.2 pass all 146. ty 0.0.108 passes 138 with 8 partial. Pyright 1.1.414 passes 138, with 5 partial and 3 failing. mypy 2.4.0 passes 83, with 55 partial and 8 failing. As with the speed file, the ty version in that table is older than 1.0. The ty results were last updated on November 23, 2026.
The table carries its own warning: "we don't recommend using it as the primary basis for choosing a type checker. It is not representative of many of the things users typically care about." The suite checks whether a tool follows the typing spec. It does not check whether the tool gives useful errors on messy real code.
That second question is where the HN thread was most useful. A few reports, each from one user:
- On a 10,000-line project that never had a type checker, ty ran in 0.5 seconds and reported 450 results. More than 400 came from one pattern: a dict of keyword arguments splatted into a call (
**kw). ty inferred the dict asdict[str, str | int]and flagged every parameter. - Another user said older ty versions fell back to
Unknownoften in code without annotations, which spread noise into hints. - A team that switched from Pyright during the betas said the few bugs they hit were all fixed.
The first report shows a common migration pattern. A large error count on day one often comes from a handful of patterns. Fix the pattern (a TypedDict would type that kwargs dict once), and the count drops fast.
Where ty still falls short
The docs are clear about gaps. Check these before you plan a switch.
Django. ty's Django support needs the django-types stub package. Support for django-stubs is "planned, but for now you must use django-types exclusively." ty does not yet recognize reverse relationship attributes (including related_name), and does not check field names in model constructors or queries. If your project leans on the django-stubs mypy plugin, stay put for now. A Django user in the thread pointed to the same gaps.
No plugins. ty has no equivalent to mypy plugins. Libraries with heavy metaprogramming that rely on a mypy plugin may lose type information.
Some mypy checks have no ty rule yet. The migration guide lists them. Two examples: mypy's import-untyped (a library ships no type information) has "None yet," and so does mypy's check for names that a runtime module does not re-export.
Module discovery is strict. ty finds third-party packages in this order, per its module docs: an active virtual environment (VIRTUAL_ENV), an active non-base Conda or Pixi environment, a .venv folder in the project root, an active base Conda environment, then a python3 or python on PATH. A user noted that packages installed under ~/.local were not found. In practice: use a virtual environment, or pass --python to point ty at one.
Minor releases can add errors. ty's versioning policy says minor releases include "changes to type-checking behavior" and "may report new type errors." Pin the version in CI.
Migrating in four steps
This plan follows ty's own migration guide and suppression docs. It assumes uv, but pip and pipx work too (see the installation page).
Step 1: Try it without changing anything
uvx runs a tool in a temporary environment, so nothing is added to your project:
uvx ty check
Run it from the project root with your virtual environment active, or point it at the environment:
uvx ty check --python .venv
Look at the error count, then group the errors by rule name. --output-format concise prints one diagnostic per line, which makes that easier. If one rule produces most of the output, as in the kwargs example above, you have a pattern to fix, not hundreds of bugs.
ty is stricter than mypy's defaults in one important way. The guide says ty "checks the bodies of unannotated functions unconditionally." mypy skips those bodies unless you turn on check_untyped_defs. So a project that is clean under default mypy can still show many ty errors from code mypy never looked at.
Step 2: Pin ty and translate your config
Add ty as a dev dependency so everyone runs the same version:
uv add --dev ty
uv run ty check
The lock file now records the exact ty version, so local runs and CI agree.
Then move your settings into pyproject.toml. The guide gives the mapping. mypy's disable_error_code and Pyright's reportXyz = "none" both become <rule> = "ignore". Severities are only ignore, warn and error.
[tool.ty.environment]
python-version = "3.12"
[tool.ty.rules]
# was disable_error_code = ["union-attr"] in mypy
missing-union-attribute = "ignore"
[[tool.ty.overrides]]
include = ["tests/**", "**/test_*.py"]
[tool.ty.overrides.rules]
missing-attribute = "warn"
The rule line turns off the ty equivalent of a mypy code you had disabled. The override block comes from the configuration reference and relaxes one rule in test files only.
A few common rule names, from the guide's mapping table:
- mypy
arg-type, PyrightreportArgumentTypemap to tyinvalid-argument-type - mypy
call-arg, PyrightreportCallIssuemap to several ty rules, such asmissing-argumentandunknown-argument - mypy
union-attrmaps tomissing-union-attributewhen only some union members lack the attribute, and tomissing-attributewhen all of them do - mypy
import-not-foundkeeps the same name in ty
Step 3: Freeze the existing errors
You will probably not fix every error in one pull request. ty gives you two ways to accept the current state and block only new errors.
Option A: inline comments. This adds a # ty: ignore[<rule>] comment to every current violation in one pass:
uv run ty check --add-ignore
Option B: a baseline file. This keeps your source files clean:
uv run ty check --update-baseline --baseline ty-baseline.json
Then set it in config so CI uses the same file:
[tool.ty]
baseline = "ty-baseline.json"
Commit the file. Later runs skip matching violations, and the editor still shows them as hints so you can fix them as you touch the code. The baseline is a preview feature. The docs say its "file format may change during preview," and if ty cannot read it after an upgrade, you regenerate it with --update-baseline. That is one more reason to pin the version.
If you plan to run mypy and ty side by side for a while, one comment can serve both. ty treats a ty: prefix inside type: ignore as its own rule and leaves the other codes to mypy:
sum_three_numbers("one", 5, 2) # type: ignore[arg-type, ty:invalid-argument-type]
ty also warns about suppression comments that no longer suppress anything, which helps clean up after you fix the underlying errors.
Step 4: Add it to CI
ty's exit codes are simple: 0 means no violations at warning or above, 1 means it found some, 2 means bad options, config or IO errors, and 101 is an internal error. If you want warnings to pass CI and only errors to fail it, add --exit-zero-on-warning.
The CLI reference lists a github output format that prints GitHub Actions annotations. A minimal job looks like this:
name: typecheck
on: [pull_request]
jobs:
ty:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@2a39bcff78b189a5800d31cfcf0205c7a3e8381e # v10.4.1
- run: uv sync
- run: uv run ty check --output-format github
The setup-uv line is pinned by commit hash, as in that action's own README. Because the lock file pins ty, a new ty minor release will not change CI results until you upgrade on purpose with uv lock --upgrade-package ty.
Optional: tighten it later
Once the baseline shrinks, the guide suggests a config that approximates mypy's or Pyright's strict mode:
[tool.ty.rules]
dynamic-function-decorator-return = "error"
missing-type-argument = "error"
possibly-unresolved-reference = "warn"
unsound-return = "error"
unsound-return is worth a look. The announcement's example is a function annotated -> list[str] that returns cursor.fetchall() from sqlite3, which is really a list of tuples. Per Astral, mypy 2.4.1 accepts it under --strict, while ty flags the list[Any] return with this rule on.
Which one should you pick?
A short decision list, based on the sources above:
- You use mypy with no plugins and CI is slow. ty is a strong candidate. Use the baseline so day one is not a wall of errors.
-
You use the django-stubs mypy plugin. Wait. ty's Django support needs
django-typesand does not yet cover reverse relations. - You use Pyright and editor lag bothers you. Try ty's VS Code extension on one project and compare.
- You already use Pyrefly. The speed gap is small, and Pyrefly passes every row in the conformance table. Switch only if you can point to a specific ty feature that solves a problem you have.
- Your codebase is mostly untyped. Expect many errors at first, because ty checks unannotated function bodies. Start with the baseline and fix patterns, not lines.
The benchmark file and the conformance table are public, and both were measured on pre-1.0 builds of ty. Running uvx ty check on your own project takes one command and gives you the number that matters for your project.
What does your project use today, and what would make you switch: speed, better errors, or a library it finally understands?
Top comments (0)