explaingit

astral-sh/ty

📈 Trending18,669PythonAudience · developerComplexity · 3/5ActiveLicenseSetup · easy

TLDR

A blazingly fast Python type checker and language server written in Rust, 10, 100× faster than existing checkers, with IDE features like auto-complete and jump-to-definition.

Mindmap

mindmap
  root((ty))
    What it does
      Type checking
      Language server
      Error detection
    Key features
      Intersection types
      Type narrowing
      Reachability analysis
    Editor support
      VS Code
      PyCharm
      Neovim
    Use cases
      Catch type bugs
      IDE integration
      Gradual typing
    Tech stack
      Rust
      Python
    Status
      Beta release
      Fast performance

Things people build with this

USE CASE 1

Catch type mismatches in Python code before runtime, like passing a number where a string is expected.

USE CASE 2

Use IDE features like auto-complete, jump-to-definition, and hover documentation powered by a language server.

USE CASE 3

Gradually add type annotations to an existing codebase without penalties for unannotated code.

USE CASE 4

Run fast type checking in CI/CD pipelines with 10, 100× speedup over traditional checkers.

Tech stack

RustPython

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

ty is a Python type checker and language server written in Rust, built by Astral, the team behind the uv package manager and the Ruff linter. A type checker is a tool that reads your Python code before you run it and flags variables or function calls where the types don't match, catching bugs like passing a number where a string was expected. ty's main selling point is speed. The readme claims it runs 10 to 100 times faster than existing Python type checkers. It is currently in beta, so its behavior and the errors it reports may change between versions. Beyond just checking types, ty also works as a language server, which means code editors can use it to power features like jump-to-definition, auto-complete suggestions, code actions, auto-import, inlay hints, and on-hover documentation. Editor integrations are provided for VS Code, PyCharm, Neovim, and others. It supports advanced type system features including intersection types (values that satisfy multiple type constraints at once), fine-grained type narrowing, and reachability analysis that uses type information to detect code that can never execute. For projects that mix typed and untyped code, ty includes a gradual guarantee mode that doesn't penalize code that hasn't been annotated yet. You can run ty quickly via uvx, or try it in a browser playground at play.ty.dev.

Copy-paste prompts

Prompt 1
How do I set up ty as a type checker in my Python project and integrate it with VS Code?
Prompt 2
Show me how to use ty's gradual guarantee mode to type-check a project that mixes typed and untyped code.
Prompt 3
What are intersection types and how does ty use them to catch more type errors?
Prompt 4
How do I run ty via uvx without installing it globally, and what does the browser playground at play.ty.dev do?
Prompt 5
Explain ty's reachability analysis feature and how it detects unreachable code using type information.
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.