Ty 1.0 Python Type Checker vs. Mypy and Pyright: Migration Guide

Migrate from mypy or Pyright to Astral's ty 1.0 Python type checker with real benchmarks, pyproject.toml baseline configs, and IDE LSP setup.

DDeven Rathore 10 min read

Astral shipped the ty 1.0 Python type checker on December 1, 2026, unifying a Rust CLI checker and a full language server into one binary. On cold checks, ty runs 10x to 100x faster than mypy and Pyright, and OpenAI reported a median 24x speedup in production. Moving a mypy-clean repository still requires deliberate configuration around unannotated functions and missing plugin hooks.

Key Takeaways

  • Measured speed and memory gains: Ty 1.0 beats mypy and Pyright by 10x to 100x on cold runs, leads 16 of 18 major ecosystem repos, and cut peak memory by 73% at OpenAI.
  • Zero-install evaluation: Run uvx ty check on any repo today, then connect the same Rust binary as an LSP in VS Code, PyCharm, Neovim, or Zed.
  • Safe gradual rollout: Use [tool.ty] in pyproject.toml with baseline = "ty-baseline.json" and ignore/warn/error levels to absorb newly surfaced errors in unannotated function bodies.
  • Intentional plugin tradeoff: Ty omits a third-party mypy plugin API in favor of typing standards, Rust speed, and native support for major frameworks like Django.

What Changed in Ty 1.0 and Why Teams Are Switching

Ty 1.0 is the first stable release of Astral's Rust-based Python type checker and language server, built by the same team behind uv and Ruff. The December 1, 2026 launch drew immediate attention on Hacker News (454 points and 114 comments) because it resolves a long-standing split in Python tooling.

For years, Python teams ran mypy in CI while relying on Pyright inside their editors. Those two tools use different inference rules, produce conflicting diagnostics, and duplicate configuration work across every repository. Shipping a single binary for both CI checks and editor intelligence removes that drift.

Under the hood, the ty 1.0 announcement and the astral-sh/ty GitHub repository highlight four core type-system milestones that make 1.0 production-ready:

  • Set-theoretic intersection types: Narrowing and combining complex types stays mathematically consistent instead of falling back to overly broad unions or Any.
  • Bidirectional inference: Expected types flow cleanly into nested expressions and callbacks, reducing boilerplate annotations.
  • A new generics solver: Complex generic hierarchies and constrained type variables resolve accurately across large modules.
  • Fine-grained incremental analysis: Editing one function invalidates only the affected dependency slice rather than re-checking whole files.

Real Benchmarks: Ty 1.0 vs. Mypy, Pyright, Pyrefly, and Zuban

Across Astral's public benchmark suite, ty 1.0 delivers 10x to 100x faster cold checks than mypy and Pyright while finishing first on 16 of 18 major Python ecosystem projects. Even against newer Rust-based competitors, ty maintains a measurable geometric-mean lead.

Tool or Deployment Benchmark Scope Verified Result vs. Ty 1.0
mypy Cold type checks Ty 1.0 is 10x–100x faster
Pyright Cold type checks Ty 1.0 is 10x–100x faster
Pyrefly Ecosystem suite (geometric mean) Ty 1.0 is 1.46x faster
Zuban Ecosystem suite (geometric mean) Ty 1.0 is 3.56x faster
Ecosystem suite (18 repos) Major open-source Python projects Ty 1.0 is fastest on 16 of 18
OpenAI production codebase Multi-million-line deployment Median 24x speedup; 73% lower peak memory

The OpenAI deployment numbers matter most for engineering leads evaluating monorepos. Cutting peak memory usage by 73% alongside a median 24x speedup changes where type checking can run. Developers on standard laptops stop fighting editor memory pressure, and CI runners no longer burn minutes waiting on cold caches.

Speed at this level also reshapes AI coding-agent workflows. When an autonomous coding agent edits a module, its reliability depends on tight edit-verify loops. Waiting 40 seconds for mypy on every iteration stalls the agent; getting sub-second incremental feedback from ty lets agents catch type regressions immediately.

That architectural payoff mirrors a broader engineering pattern we analyzed in Rust-Anything vs. Fast-Anything: Full Rust Rewrites vs. Hot-Path FFI with AI Coding Agents. Whole-program static analysis spends its time traversing massive AST and dependency graphs, where a ground-up Rust architecture removes interpreter overhead across the entire pipeline.

Quickstart and IDE Language Server Setup

You can audit an existing repository in seconds without changing your lockfile or virtual environment by running uvx ty check. That single command downloads and runs the binary in isolation so you can measure diagnostic volume before committing to a migration.

# Zero-install audit on an existing repository
uvx ty check

Once the output looks manageable, wire ty into CI directly beside uv and Ruff so dependency sync, linting, and type checking share one fast workflow.

# Example CI verification steps alongside uv and Ruff
- run: uv sync --frozen
- run: uv run ruff check .
- run: uv run ty check

Running all three Rust tools in sequence keeps pull-request validation predictable and eliminates separate Python runtime installs for linters and checkers. For engineers building modern Python workflows from scratch—covered in our step-by-step Python developer guide—adopting uv, Ruff, and ty together avoids years of fragmented configuration.

Configuring the Ty Language Server Across Editors

Because ty ships its CLI and language server in the same binary, editor diagnostics match CI output line for line. The ty official documentation outlines first-class LSP setup across four major editors:

  • VS Code: Install the Astral ty extension so the editor uses the ty language server for instant diagnostics, hover types, inlay hints, and auto-imports.
  • PyCharm: Enable ty as the external language server in project settings to pair JetBrains navigation with ty's incremental type engine.
  • Neovim: Register ty server through your native LSP configuration to get sub-second diagnostics and hover documentation without heavy Node.js runtimes.
  • Zed: Enable ty in your Python language server settings for native inlay hints, auto-imports, and real-time error reporting.

Pro Tip When enabling the ty language server in VS Code or Neovim, disable overlapping type diagnostics from Pyright or Pylance in the same workspace. Running two language servers side by side produces duplicate squiggles and wastes memory.

Migrating From Mypy to Ty Without Breaking CI

Migrating a production codebase from mypy works best when you lock existing debt into a baseline file and ratchet rules up gradually inside pyproject.toml. Trying to fix every diagnostic in a single pull request creates massive diffs and invites merge conflicts.

Start by adding a centralized [tool.ty] block to pyproject.toml that pins your target python-version, references baseline = "ty-baseline.json", and assigns explicit ignore, warn, or error severities to noisy rule categories.

[tool.ty]
baseline = "ty-baseline.json"
 
[tool.ty.environment]
python-version = "3.12"
 
[tool.ty.rules]
unresolved-import = "warn"
possibly-missing-attribute = "warn"
invalid-argument-type = "error"

With baseline = "ty-baseline.json" active, ty tracks pre-existing diagnostics so CI only fails on new regressions introduced in fresh commits. Your team can burn down legacy errors module by module and upgrade warn rules to error on your own schedule.

Why Mypy-Clean Codebases Surface New Errors

Many teams expect a repository that passes mypy with zero errors to pass ty cleanly on the first try. In practice, ty almost always surfaces new diagnostics immediately—and most of them come from one default behavior.

Ty checks unannotated function bodies by default. Standard mypy skips the body of any function that lacks parameter or return annotations unless strict options are explicitly enabled. Legacy utility modules, old scripts, and glue code often hide real attribute or call-site bugs inside untyped functions that mypy never inspected.

Watch Out Do not flip ty to blocking CI checks on day one without generating ty-baseline.json. Newly inspected unannotated bodies can surface hundreds of latent issues in a single run and stall active feature branches.

Translating Mypy Overrides and Type Ignores

Migrating per-module [mypy-foo.*] sections requires mapping old silence rules onto ty's rule levels. Instead of blindly muting entire third-party subtrees, check which specific rules fire—most often missing stubs or unresolved-import—and downgrade only those rules to warn or ignore in pyproject.toml.

Inline # type: ignore comments deserve an audit during the switch as well. Generic # type: ignore directives silence ty just like mypy, which helps during a dual-running transition period. However, mypy-specific error codes inside comments may no longer match ty's diagnostic names, so plan a cleanup pass once mypy is removed from CI.

The Real Tradeoffs: No Mypy Plugins and When to Wait

Astral made a deliberate architectural decision not to support third-party mypy plugins in ty 1.0. If your codebase depends heavily on custom plugin hooks to synthesize dynamic attributes or rewrite class definitions during type checking, this is the primary constraint to evaluate.

Mypy plugins execute arbitrary Python code inside the type checker. While flexible, that design locks teams to a single checker, breaks editor portability, and undermines fine-grained incremental caching. Instead of re-implementing a Python plugin runtime inside a Rust binary, Astral relies on standard Python typing semantics and native built-in support for major frameworks like Django.

When to Migrate Now vs. When to Wait

Use this decision matrix to decide whether your team should switch immediately, run ty in shadow mode, or stay on mypy for now.

Scenario Recommended Action Why
Standard uv + Ruff repositories Migrate now Single Rust toolchain for CI and editor LSP with immediate speed gains
Large monorepos with slow CI or laggy Pyright LSP Migrate with ty-baseline.json 10x–100x cold speedups and lower memory usage remove daily developer friction
Django apps relying on standard typing Evaluate now Built-in native Django support removes the need for third-party plugin glue
Codebases with heavy custom internal mypy plugins Stay on mypy (or shadow-test ty) Ty does not execute third-party mypy plugins; rewriting hooks takes planning
Niche metaprogramming ORMs tied to plugin synthesis Wait and track native support Dynamic attributes generated only by mypy plugins will produce false positives

If you sit in the middle—mostly standard Python with one plugin-heavy service—run uvx ty check in non-blocking CI alongside mypy. You can capture instant LSP feedback across the clean packages while keeping mypy authoritative on the plugin-dependent modules until you simplify those patterns.

Frequently Asked Questions

Is Astral's Ty 1.0 a Drop-In Replacement for Mypy and Pyright?

For standard typed Python repositories without custom plugins, ty 1.0 replaces both mypy in CI and Pyright in your editor with a single Rust binary. However, it is not a zero-diff swap because ty checks unannotated function bodies by default and uses centralized [tool.ty] configuration in pyproject.toml rather than mypy's legacy ini overrides.

Does Ty 1.0 Support Mypy Plugins Like pydantic.mypy or django-stubs?

No. Astral deliberately excluded a third-party mypy plugin architecture from ty 1.0 to protect deterministic typing standards, Rust execution speed, and incremental analysis. Instead, ty relies on standard Python typing features and native built-in support for major frameworks such as Django.

How Do You Adopt Ty 1.0 Gradually Without Fixing Thousands of Errors at Once?

Run uvx ty check to audit your repository, then configure baseline = "ty-baseline.json" under [tool.ty] in pyproject.toml so CI ignores pre-existing diagnostics and blocks only new regressions. Combine the baseline with rule severities (ignore, warn, and error) to tighten checks incrementally as your team cleans up legacy modules.

Deven Rathore

Engineering workflows, AI coding tools, and developer guides published on DuneBook.

Technical Documentaries · October 29, 2024

The Untold Story of Stack Overflow

Before Stack Overflow, programmers always needed a place to ask questions and find help—whether it was old forums, chat rooms, or paid sites. For years,…