Coderefercoderefer
CoursesWebinarsBlogAbout
Coderefercoderefer

Discover. Learn. Automate. Grow.

Learn

  • Courses
  • Webinars
  • Blog
  • Search

Company

  • About
  • Contact
  • FAQ

Legal

  • Privacy Policy
  • Terms of Service
  • Refund Policy
© 2026 Coderefer. All rights reserved.
HomeBlogHow to Switch From mypy to ty 1.0: Astral's Rust Type Checker Hits Production
ai-toolsDecember 2, 20268 min read

How to Switch From mypy to ty 1.0: Astral's Rust Type Checker Hits Production

ty 1.0 is out: Astral's Rust type checker now runs at OpenAI with a 24x speedup. Here's how to migrate off mypy, what breaks, and what still doesn't work.

V

Vamsi Tallapudi

Manager, Architect Technology at Cognizant

How to Switch From mypy to ty 1.0: Astral's Rust Type Checker Hits Production

Astral's ty hit version 1.0 on December 1, 2026, and the headline number is hard to ignore: ty is now the default type checker at OpenAI, where Astral says it delivered a 24x median speedup and cut peak memory use by 73% across "many millions" of lines of Python. If you're still running mypy on a large codebase and watching CI crawl, this is the moment to actually look at switching.

That context matters more than usual here. OpenAI agreed to acquire Astral back in March 2026, folding the team behind uv, Ruff, and ty into the Codex org. So when Astral says ty is "production-ready," they're not just talking about outside users, they're talking about their own parent company's Python estate. That's a different kind of dogfooding than most dev tools get before calling themselves 1.0.

What actually shipped in ty 1.0?

ty is a Python type checker and language server written in Rust, built as a direct alternative to mypy, Pyright, and Meta's Pyrefly. It's been in beta for most of 2026, and the 1.0 release is Astral's line in the sand: stop treating it as experimental.

The feature list for 1.0, per Astral's launch post:

  • A new generics solver with bidirectional inference
  • Built-in understanding of Pydantic, Django, pytest, and attrs, without plugins
  • Inferred return types for functions you never bothered to annotate
  • An --fix flag that auto-applies certain fixes
  • Diagnostic baselines, so you can freeze existing errors and only get flagged on new ones
  • A strict generic-narrowing mode and partial-Any detection in return types
  • Preview support for PEP 723 inline script metadata, wired through uv

None of that is a huge leap on its own. What's new is that Astral is confident enough in the conformance numbers to ship it as default-recommended, not opt-in.

How fast is ty, really?

Speed was always ty's pitch, going back to the "10x, 50x, 100x faster than mypy" claims from the original preview release. The 1.0 numbers are more specific and more modest, which is a good sign that Astral is measuring rather than marketing.

CheckerSpeed vs. ty (geomean)LSP speed vs. ty
tybaseline (fastest on 16/18 benchmarked projects)baseline (fastest on 14/17 projects)
Pyrefly1.46x slower7.73x slower
Zuban3.56x slower3.22x slower

Those numbers come from Astral's own ecosystem benchmark suite, so take them as a vendor's best case, not an independent audit. Still, they're a lot more believable than "100x faster" marketing copy, and nobody's seriously disputing that the Rust-based checkers (ty, Pyrefly, Zuban) all beat mypy and Pyright on raw throughput.

The OpenAI numbers are the ones worth sitting with: a 24x median speedup and 73% less peak memory, at a scale where that translates to real CI minutes and real infrastructure cost, not a toy benchmark.

Is ty actually correct, or just fast?

This is the part mypy users should care about more than the speed charts. A fast checker that misses real bugs or screams false positives all day isn't a checker you keep.

Astral runs ty against the official Python typing conformance test suite, and the beta-to-1.0 jump is genuinely steep: 224 false positives and 405 false negatives at beta, down to 14 and 13 respectively at 1.0. For comparison, Astral's own numbers put mypy at 190 false positives and 109 false negatives on the same suite.

Independent trackers tell a slightly different story depending on which conformance metric they use. One community benchmark (cited in the Hacker News discussion on the launch) has ty climbing from 53% conformance in March to roughly 97% by release, while Pyright sits around 97.8% and Zuban around 96.4%. Pyrefly's conformance score varies quite a bit between trackers, so don't treat any single percentage as gospel. The honest takeaway: ty went from "clearly behind" to "roughly tied with the established tools" in under a year, which is the real story, not whether it's 0.8 points ahead or behind Pyright on a specific day.

One HN commenter put it well: conformance suites test spec edge cases most people never hit in real code. Don't pick a type checker off a leaderboard. Pick it off whether it's quiet on your actual codebase.

What breaks when you move from mypy to ty?

Astral publishes an actual migration guide, and it's refreshingly honest about what doesn't map cleanly. The short version:

  1. Ignore comments change syntax. # type: ignore[code] becomes # ty: ignore[rule]. Pyright's # pyright: ignore[reportXyz] maps the same way.
  2. There's no strict = True flag. ty's defaults are already stricter than mypy's standard mode in several ways, so there's nothing to flip. If you want parity with mypy's strict mode, you turn on a specific set of rules that are off by default: dynamic-function-decorator-return, missing-type-argument, possibly-unresolved-reference, and unsound-return.
  3. Unannotated function bodies get checked, period. mypy's check_untyped_defs and Pyright's analyzeUnannotatedFunctions are both optional toggles. In ty, that behavior isn't configurable, it's just on. If your codebase has a lot of untyped legacy code, expect noise here.
  4. mypy plugins don't exist in ty. Instead you get built-in, hardcoded support for Pydantic, Django, attrs, and pytest. If your plugin does something custom, there's no equivalent hook.
  5. Severity levels are ignore, warn, error. Pyright's information level and basedpyright's hint level don't have a direct match, so you lose that granularity and collapse everything into warn.

None of these are dealbreakers, but they're exactly the kind of thing that turns a "quick swap" into a half-day of config archaeology if you don't know about them going in.

How do you actually run the migration?

Astral's own recommendation is boringly sensible, which is usually a good sign for a CLI tool:

  1. Run it cold first. uvx ty check against your existing project, no config changes, no install. See how loud it is before touching anything.
  2. Suppress the noise in one pass. ty check --add-ignore inserts suppression comments at every existing error site, so you start from a clean slate instead of fixing everything at once.
  3. Or freeze instead of suppressing. ty check --update-baseline records current diagnostics into a baseline file, so only new issues show up in CI going forward. This is the better option if you plan to clean things up gradually rather than inline-ignoring forever.
  4. Translate your config. Your mypy.ini, setup.cfg, or [tool.mypy] block needs rewriting into [tool.ty.rules] and [tool.ty.environment]. There's a community tool for this, ty-migrate, that parses mypy/pyright/basedpyright configs and rewrites ignore comments automatically with uvx ty-migrate --rewrite-ignores --dry-run --diff --report. It's third-party, not an Astral project, so review the diff before trusting it on anything load-bearing.
  5. Install it for real once you're happy. uv tool install ty@latest, or grab the VS Code extension for the language server side.

If you just want to kick the tires without any of this, there's a browser playground at play.ty.dev.

Where does ty still fall short?

The HN thread on the 1.0 launch surfaced the gaps that the launch post obviously doesn't lead with, and they're worth knowing before you commit:

  • Django support is real but shallow. ty has built-in Django awareness now, but it doesn't understand reverse relations or queryset chains well. One commenter's take, which I think is correct: you have to write Django in a more type-friendly style to get value here, ty isn't going to infer its way through deeply dynamic ORM patterns.
  • It falls back to Any more aggressively than Pyright or mypy on untyped code, according to users testing it against mixed codebases.
  • finally block handling has reported bugs.
  • Package discovery misses some ~/.local installs in certain environments.

None of that is disqualifying for a 1.0, but it does mean "run it and see what breaks" is still the right first step, not "trust the blog post and flip the switch in CI."

Should you actually switch?

If you're on a small-to-medium codebase and your main gripe with mypy is speed, yes, try it this week. The editor experience (go-to-definition, completions, incremental checking) is reportedly a bigger quality-of-life win than the raw check speed for day-to-day work, and the downside risk is low since you can run ty alongside mypy before cutting over.

If you're running a large Django monolith with years of dynamic patterns and a pile of mypy plugins doing real work, I'd wait a release or two, or budget real time for the migration rather than treating it as a weekend task. The conformance gap has mostly closed, but "mostly closed" on a spec test suite and "silent on my actual 500k-line app" are different claims, and only your codebase can answer the second one.

The bigger strategic wrinkle is one the HN crowd flagged and I think is underrated: OpenAI now owns the team behind ty, and Microsoft effectively controls Pyright through its VS Code/Pylance investment. Two companies now have an outsized say in how Python and TypeScript tooling evolves. MIT licensing means a fork is always possible if that goes somewhere unpleasant, but it's a real concentration of influence worth watching, not a hypothetical.

If you're coming from a different direction, comparing Rust-based tooling rewrites more broadly or thinking about config migration patterns in other ecosystems, the playbook here (run cold, suppress or baseline, translate config, cut over gradually) generalizes well beyond just mypy.

Watch

ty: Fast Python Type Checking with Carl Meyer

FAQ

What is ty 1.0?
ty is a Python type checker and language server written in Rust, built by Astral (the team behind uv and Ruff). Version 1.0 shipped December 1, 2026, and Astral now recommends it for production use, including at OpenAI, which owns Astral after a March 2026 acquisition.
Is ty faster than mypy?
Yes, by a wide margin. Astral says ty was the fastest checker on 16 of 18 benchmarked ecosystem projects, and OpenAI saw a 24x median speedup and 73% lower peak memory versus its prior setup after switching internally.
How do I migrate from mypy to ty?
Run uvx ty check cold against your project first to see the noise level, then either suppress existing errors with ty check --add-ignore or freeze them with ty check --update-baseline so only new issues block CI. Translate your mypy config into [tool.ty.rules] by hand or with the community tool ty-migrate, then install with uv tool install ty@latest.
Does ty support mypy plugins?
No. ty does not run mypy plugins. Instead it ships built-in, hardcoded support for Pydantic, Django, pytest, and attrs. If your project relies on a custom mypy plugin, there's no direct equivalent in ty.
Is ty as accurate as mypy or Pyright?
It's gotten much closer. On the Python typing conformance test suite, Astral says ty went from 224 false positives and 405 false negatives at beta to 14 and 13 at 1.0, compared to mypy's reported 190 false positives and 109 false negatives on the same suite. Community trackers cited in the Hacker News discussion put ty's conformance score around 97% at release, close to Pyright (97.8%) and Zuban (96.4%).
What are ty's known weaknesses?
Users on Hacker News reported that ty's Django support doesn't handle reverse relations or querysets well, it falls back to Any more aggressively than mypy or Pyright on untyped code, it has reported bugs around finally blocks, and it can miss some ~/.local package installs.
Why does OpenAI owning Astral matter?
OpenAI agreed to acquire Astral in March 2026 and folded its team into the Codex org. That means ty's lead maintainers now report inside the same company that runs Codex, and OpenAI is ty's largest internal production user, which is unusual visibility for a developer tool's own dogfooding story.
python rust type-checking astral 2026

Comments

    Get AI tricks that save you hours every week

    New AI tools, automation workflows, and course drops — straight to your inbox. Join 2,400+ builders.

    Read Next

    Rust 1.100: The Never Type Is Finally Stable, Cargo Gets Dependency Cooldowns
    ai-tools

    Rust 1.100: The Never Type Is Finally Stable, Cargo Gets Dependency Cooldowns

    Rust 1.100 stabilizes the never type after 10 years and 5 attempts, and Cargo now supports dependency cooldowns to block fresh, potentially malicious crate versions.

    November 14, 20266 min read
    Python's JIT Is Being Removed: PEP 836 Withdrawn, What 3.15 and 3.16 Mean for You
    ai-tools

    Python's JIT Is Being Removed: PEP 836 Withdrawn, What 3.15 and 3.16 Mean for You

    PEP 836 was withdrawn on Oct 19, 2026, so Python's experimental JIT is leaving CPython's main branch. Here's what changes in 3.15, 3.16, and what doesn't.

    October 28, 20267 min read
    HTTP2Shell (CVE-2026-111497) Explained: Is Your Node.js, Python, or Bun App Exposed?
    ai-tools

    HTTP2Shell (CVE-2026-111497) Explained: Is Your Node.js, Python, or Bun App Exposed?

    HTTP2Shell (CVE-2026-111497) is a 9.2-CVSS Brotli decoder RCE hitting Node.js, Python, and Bun. Here's what's affected, which versions fix it, and how to patch fast.

    October 25, 20268 min read
    View all posts →