sh-tyUltra-fast Python type checker

ty is an ultra-fast Python type checker and language service program developed by Astral (the R&D team of the well-known tools uv and Ruff) based on the Rust language.
It runs 10~100 times faster than mainstream tools such as mypy and Pyright, and not only outputs detailed and easy-to-understand error prompt information, but also supports core IDE functions such as code auto-completion and hover view comments. The tool can be tried directly with the command uvx ty check. With ty, developers can troubleshoot potential code bugs in advance, greatly improve coding efficiency with real-time feedback, and significantly optimize development productivity in editors like VS Code.

Summary in one sentence:
ty is a performance-driven Python static type checker + language server written in Rust with the goal of becoming the next generation of Pyright/mypy.

Why do you need a new Python type checker?

Python’s type system has evolved rapidly in recent years:

  • typingPEP 484 / 544 / 563 / 695
  • ProtocolLiteralTypedDict
  • There is more and more engineering practice of “writing Python like a static language”

But the reality is:

  • mypy: Strict rules, but slow, engineering experience is “academic”
  • Pyright: Fast, but complex and huge implementation (TypeScript)
  • In large Python projects, type checking has become a performance bottleneck for CI

The Astral team’s judgment is straightforward:

Python’s type checking has reached the stage of “must be rewritten once”.

What is ty? It’s not “another mypy”

TY is not a simple lint tool, but a complete type analysis engine:

  • ✅ Static Type Checker
  • ✅ Language Server (LSP).
  • ✅ Incremental analysis
  • ✅ Designed for large codebases

It is positioned closer to:

“Rust-Grade Performance + Engineering-Grade Implementation of Python-type systems”

Core design goal: speed first

Rewrite everything in Rust

There is only one principle of the first nature of ty: fast.

  • Implemented using Rust 
  • Strong typing + zero-cost abstraction
  • Memory layout, concurrency, and lifecycle are all controllable

This makes ty theoretically have:

  • Orders of magnitude faster than Python implementations
  • Closer to the bottom layer than TypeScript implementations

Incremental Analysis

The problems with traditional type checks are:

Change a line of code → re-analyze the entire project

ty’s strategy is:

  • Refine dependency graphs
  • Only the smallest subgraph affected is reanalyzed
  • Optimized for IDE scenarios, not just for the CLI

This is crucial for large repositories + high-frequency editing .

The type system is not “just run as long as it can”, but “correctly structured”

ty doesn’t just “check if the annotations are correct”, but tries to build:

  • Constraint system between types
  • Type inference path
  • Type merging, intersecting, narrowing

This means that it is not a hack, but a type engine that can evolve over time.

ty ≠ is only for the CLI, it is LSP first

ty assumes from the beginning that it will run in the editor.

Typical competencies supported:

  • Hover type hover
  • Go to definition
  • Instant feedback on type errors
  • Automatic Import (Future)

This makes ty more like:

rust-analyzer for the Python world

Instead of a tool that “gives you a bunch of errors after running”.

The difference between it and Pyright / mypy

DimensionsmypyPyrightty
Implementation languagePythonTypeScriptRust
Performance GoalsCorrectnessCorrect + fastExtremely fast
Architectural complexityMediumHighHigh, but bottom
IDE prioritylowHighExtremely high
Project phaseMatureMatureEarly (but ambitious)

One comment:

TY is a type checker that “backwards designs from the future”.

Github:https://github.com/astral-sh/ty
Tubing:

Scroll to Top