ty 1.0 Is Here: Astral's Python Type Checker vs mypy vs Pyright

Astral's ty 1.0 is production-ready. How it compares to mypy and Pyright, how to install and configure it, and how to migrate an existing project safely.

ty 1.0 Is Here: Astral's Python Type Checker vs mypy vs Pyright
On this page

Every Python project I’ve worked on eventually hits the same wall: the codebase grows, mypy takes long enough that people stop running it locally, and type checking quietly becomes “something CI does.” So when Astral — the team behind Ruff and uv — announced on December 1, 2026 that ty 1.0 is ready for production use, I wanted to know whether it actually changes that situation, or whether it’s just another fast tool with rough edges.

This post covers what ty is, how it compares to mypy and Pyright, how to install and configure it, and — most importantly — how to migrate an existing project without drowning in a thousand new errors on day one.

What Is ty? Astral’s Python Type Checker and Language Server

ty is a Python type checker and language server, written in Rust. Astral describes it as an alternative to tools like mypy, Pyright and Pyrefly. That double role matters: the same engine that runs ty check in your CI also powers autocompletion, go-to-definition and inline diagnostics in your editor.

If you’ve used Ruff, the pitch will feel familiar. Ruff replaced a stack of Python linters (flake8, isort, pyupgrade and friends) with one very fast binary. uv did the same for pip, virtualenv and pip-tools. ty is the third piece: a fast replacement for the type checker.

The 1.0 announcement says Astral is “ready to recommend it for production use, for all users.” That’s a notable change from the beta period, where the honest advice was “try it, but keep mypy around.”

ty Python type checker architecture showing CLI and language server sharing one Rust engine

ty 1.0 Benchmarks: How Fast Is It Really?

Speed is the headline, so let’s look at the numbers Astral published (measured on an M3 Max, without caching):

  • CLI cold checks: ty was the fastest type checker on 16 of 18 open-source projects tested. By geometric mean it was 1.46x faster than Pyrefly and 3.56x faster than Zuban — and both of those are also written in Rust.
  • Editor diagnostics after an edit: ty was the fastest language server on 14 of 17 projects, 7.73x faster than Pyrefly and 3.22x faster than Zuban.
  • Against mypy and Pyright: the ty docs claim 10x–100x faster checks than mypy and Pyright.

Astral also reported a real-world migration: ty is now the default type checker at OpenAI, where the internal switch gave a median 24x speedup and a 73% reduction in peak memory usage.

Benchmarks are always vendor-published and best-case, so treat these as “order of magnitude” rather than a promise for your codebase. But even if your project only sees a fraction of that, going from “mypy takes 90 seconds” to “ty takes a few seconds” changes behaviour. People actually run a type checker when it’s instant.

Correctness, not just speed

A fast checker that misses bugs isn’t useful. Astral points to the official typing conformance suite (which they call “an imperfect proxy” for real-world quality). At 1.0, ty has 14 false positives and 13 false negatives, down from 224 and 405 at beta. For comparison, mypy sits at 190 false positives and 109 false negatives on the same suite.

How to Install ty

You have several options. If you already use uv, the fastest way to try it is to run it without installing anything:

uvx ty check

That checks every Python file in the current project. For a real setup, add it as a dev dependency so everyone on the team uses the same version:

uv add --dev ty
uv run ty check

To upgrade the project’s pinned version later:

uv lock --upgrade-package ty

Other install methods from the official docs:

# Global install with uv
uv tool install ty@latest

# pipx
pipx install ty

# Plain pip
pip install ty

# Standalone installer (macOS / Linux)
curl -LsSf https://astral.sh/ty/install.sh | sh

There’s also a Docker image if you want it in a CI container:

COPY --from=ghcr.io/astral-sh/ty:latest /ty /bin/

ty Commands You’ll Actually Use

The CLI is small. The commands that matter day to day:

ty check                    # check the whole project
ty check src/ tests/        # check specific paths
ty check --watch            # re-check on file changes
ty check --fix              # apply available automatic fixes
ty explain rule invalid-argument-type   # explain what a rule does
ty server                   # start the language server (editors call this)

For CI, the output format flag is useful. GitHub, GitLab, JUnit and SARIF formats are all supported:

ty check --output-format github

By default ty exits with code 1 if it reports any warning or error, so a CI step fails on any diagnostic. If you want warnings to be informational only, set error-on-warning = false under [tool.ty.terminal] in your configuration.

You can also change rule severity straight from the command line, which is handy for experiments:

ty check --warn possibly-unresolved-reference --ignore division-by-zero

Configuring ty in pyproject.toml

ty reads configuration from a [tool.ty] table in pyproject.toml, or from top-level keys in a ty.toml file. Here’s a realistic starting configuration:

[tool.ty.environment]
python-version = "3.12"

[tool.ty.rules]
possibly-unresolved-reference = "warn"
division-by-zero = "ignore"

[[tool.ty.overrides]]
include = ["tests/**", "**/test_*.py"]

[tool.ty.overrides.rules]
missing-attribute = "warn"

A few things to note:

  • Rule severity has three levels: ignore, warn and error. That’s it. If you’re coming from Pyright, its “information” level maps to warn.
  • all is a special rule name that sets a default for every rule, so all = "warn" is a quick way to make everything non-blocking during a migration.
  • Overrides let you relax rules for tests or generated code without weakening the rest of the codebase.
  • Environment settings cover the interpreter (python), extra search paths (extra-paths), the target platform (python-platform) and source roots (root).

ty pyproject.toml configuration with rules and per-file overrides

Suppressing a ty error on one line

Sometimes the type checker is wrong, or you know something it doesn’t. ty’s suppression comment looks like this:

a = 10 + "test"  # ty: ignore[unsupported-operator]

Multiple rules on one line are comma-separated:

sum_three_numbers("one", 5)  # ty: ignore[missing-argument, invalid-argument-type]

The standard PEP 484 # type: ignore comment also works, which is good news for migrations — your existing mypy ignores don’t break. ty also warns about unused suppression comments by default, so stale ignores get flagged instead of piling up forever.

ty vs mypy vs Pyright: The Real Differences

Here’s the comparison I wish I’d had when deciding whether to switch:

ty 1.0 mypy Pyright
Written in Rust Python (mypyc-compiled) TypeScript
Language server Built in No (separate tools) Built in (Pylance in VS Code)
Checks unannotated function bodies Yes, by default Only with --check-untyped-defs Yes
Plugin system No — built-in support for Pydantic, Django, attrs, pytest Yes (mypy plugins) No
Severity levels ignore / warn / error error codes on/off none / information / warning / error
Suppression comment # ty: ignore[rule] # type: ignore[code] # pyright: ignore[rule]

Gradual typing done differently

The most interesting technical difference is ty’s foundation in gradual and set-theoretic typing. In practice that shows up in two places.

First, intersection types are first-class. If you narrow a value with two isinstance checks, ty keeps both facts. Astral’s example infers Sized & Iterable[int], where mypy inferred Never, Pyright inferred just Sized, and Pyrefly inferred a union. That means fewer false positives after narrowing, and better autocompletion.

Second, ty’s defaults favour usefulness over strict soundness, but soundness is available as opt-in. For example, the unsound-return rule can flag functions that return partially-Any values like list[Any] — cases that mypy’s warn-return-any misses.

No plugins — and why that’s mostly fine

mypy users with Django or Pydantic projects often rely on mypy plugins. ty has no plugin system, but it ships built-in support for Pydantic, Django, attrs and pytest. If your project depends on a niche mypy plugin, check whether ty understands that library before switching.

Third-party stubs

ty doesn’t bundle third-party stubs. If you import yaml, install the stub package yourself:

uv add --dev types-PyYAML

ty picks up stub packages from your project’s environment automatically.

How to Migrate from mypy to ty (Step by Step)

The worst way to migrate is to run ty check on a big codebase, see 800 errors, and give up. Here’s the approach that works:

Step 1: Run it read-only first

uvx ty check

Look at the error counts by rule. Often a handful of rules account for most of the noise — usually missing stubs or unannotated third-party code.

Step 2: Install missing stubs

Fix the unresolved-import style errors by adding the right types-* packages. This alone usually removes a big chunk of the output.

Step 3: Freeze the existing errors

You don’t have to fix everything before adopting ty. Two options:

# Option A: add inline ty: ignore comments everywhere in one pass
ty check --add-ignore

# Option B (preview): record a baseline file so CI only fails on NEW errors
ty check --update-baseline --baseline ty-baseline.json

With a baseline, add baseline = "ty-baseline.json" under [tool.ty]. Note that the baseline feature is marked as preview in the docs, so it may change. I prefer the baseline over inline comments because it doesn’t touch hundreds of files in one commit.

Step 4: Map your mypy/Pyright settings

Translate your existing config. Disabled error codes in mypy (disable_error_code) and reportXyz = "none" in Pyright both become <rule> = "ignore" under [tool.ty.rules]. The ty docs have a “coming from mypy or Pyright” page with a mapping table.

If you want strictness close to mypy’s --strict, the ty docs recommend starting with:

[tool.ty.rules]
dynamic-function-decorator-return = "error"
missing-type-argument = "error"
possibly-unresolved-reference = "warn"
unsound-return = "error"

[tool.ruff.lint]
extend-select = ["ANN", "PYI"]
preview = true

Note how missing annotations are left to Ruff’s ANN rules rather than the type checker. That split — Ruff for style and annotation coverage, ty for type correctness — is how Astral intends the tools to be used together.

Step 5: Run both in CI for a while

For a week or two, run mypy and ty side by side. When ty catches everything mypy did (and usually more), remove mypy.

Setting Up ty in VS Code, Neovim and PyCharm

Because ty is also a language server, editor setup is where you feel the speed most.

VS Code: install the official ty extension from the Marketplace (astral-sh.ty). By default it turns off the Python extension’s language server, so you don’t get duplicate diagnostics. If you want to keep Pylance for completions and use ty only in CI, set:

{
  "python.languageServer": "Pylance",
  "ty.disableLanguageServices": true
}

Neovim 0.11+ with nvim-lspconfig:

vim.lsp.config('ty', { settings = { ty = {} } })
vim.lsp.enable('ty')

PyCharm: recent versions have ty under Settings → Python → Tools.

Anything else: any editor that speaks LSP can run ty server.

ty language server inline diagnostics in VS Code editor

FAQ: ty Python Type Checker

Is ty production-ready?

Yes, according to Astral as of the 1.0 release on December 1, 2026. Some features, like baseline files and PEP 723 script support, are still marked as preview.

Does ty replace Ruff?

No. Ruff is a linter and formatter; ty is a type checker. They’re designed to run together, and the recommended strict setup uses Ruff’s ANN rules alongside ty.

Will my existing # type: ignore comments still work?

Yes. ty honours the standard # type: ignore. A bare # type: ignore suppresses everything on that line; # type: ignore[ty:rule-name] suppresses only that ty rule.

Is ty faster than mypy?

Astral’s docs claim 10x–100x faster than mypy and Pyright. Your mileage will depend on project size and caching, but even conservative results are a big jump.

Should I switch from Pyright/Pylance?

If you’re happy with Pylance in VS Code, there’s no urgency. The strongest reason to switch is consistency: one engine for the editor and CI, so “it’s green in my editor but red in CI” stops happening.

My Take: Should You Switch to ty?

For a new project in 2026, I’d start with ty from day one — uv add --dev ty, a small [tool.ty] section, done. For an existing project on mypy, the baseline-based migration makes the switch low-risk, and the speed alone pays for the afternoon it takes.

The one case where I’d wait is a project that leans heavily on a custom mypy plugin that ty doesn’t understand. Everything else — Django, Pydantic, pytest, attrs — is covered.

If you’re modernising your Python setup, it pairs well with the async patterns from my Python asyncio guide and the language changes in Python 3.14 . Type checking used to be the slow, annoying part of the Python toolchain. With ty, it’s finally fast enough to run without thinking about it.

Share X / Twitter LinkedIn
Previous Python Rust Is Coming to CPython: The Python 3.16 Roadmap Explained

Keep reading