gitmyhub

ty

Python ★ 19k updated 2d ago

An extremely fast Python type checker and language server, written in Rust.

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.

RustPythonsetup: easycomplexity 3/5

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.

Where it fits