{"slug": "ty-1-0", "title": "ty 1.0", "summary": "Astral released ty 1.0, an extremely fast Python type checker and language server written in Rust, and said ty is now the default and most widely-deployed type checker at OpenAI, where migrating to it produced a median 24x speedup and a 73% reduction in peak memory usage. In Astral's benchmarks, ty was the fastest type checker on 16 of 18 ecosystem projects, 1.46x faster than Pyrefly and 3.56x faster than Zuban by geometric mean, and the fastest language server on 14 of 17 projects. A November audit of the 25,000 most-downloaded PyPI packages found 11.6% of repositories with a type checker used ty, third behind mypy and Pyright, while among repositories created in the last year 22.6% used ty, 26.0% used Pyright and 62.9% used mypy.", "body_md": "TL;DR:ty is an extremely fast Python type checker and\nlanguage server, written in Rust, and designed as an alternative to tools like mypy, Pyright, and\nPyrefly.\n\nty is now the default and most widely-deployed type checker at\nOpenAI, providing coverage for many millions of lines of critical Python. Internally, migrating to\nty resulted in a median 24x speedup and 73% reduction in peak memory usage.\n\nWe’re ready to recommend it for production use, for all users.\n\nAt Astral, we build high-performance developer tools for the Python ecosystem. We're best known for\nuv, our Python package manager, and\nRuff, our linter and formatter.\n\nToday, we're announcing the 1.0 release of ty, an extremely fast\nPython type checker and language server, written in Rust.\n\nYou can install ty today with uv tool install ty@latest, or via our\nVS Code extension.\n\nLike the rest of the Astral toolchain, ty was built with an\nobsessive focus on performance.\n\nIn our benchmarks, ty was the fastest type checker on 16 out of 18 ecosystem projects: 1.46x faster\nthan Pyrefly and 3.56x faster than Zuban (both written in Rust), by geometric mean.\n\nty’s architecture is built around \"incrementality\", which makes live updates extremely fast in the\ncontext of an editor or long-lived process. (In the future, we plan to leverage this incrementality\nto power workflows beyond the editor.)\n\nIn our editor benchmarks, ty was the fastest language server on 14 out of 17 ecosystem projects\n(7.73x faster than Pyrefly, and 3.22x faster than Zuban).\n\nty has grown rapidly over the past few months (despite its Beta status), with adoption in widely\nused projects like FastAPI and tox.\n\nIn a November audit of the 25,000 most-downloaded PyPI packages, 11.6% of repositories with a type\nchecker used ty, placing it third behind mypy and Pyright. Among those repositories created in the\nlast year, 22.6% used ty, 26.0% used Pyright, and 62.9% used mypy.\n\nty takes a novel approach to Python typing based on gradual and set-theoretic typing. It’s our\nbelief that this foundation will enable us to build more than a “faster type checker.” We want to\nbuild a better type checker, and one that can co-evolve with Python’s type system.\n\nOn the Python typing conformance suite, an imperfect proxy for real-world correctness, ty now\nrecords just 14 false positives and 13 false negatives, down from 224 and 405 at the Beta release.\n(For comparison, mypy reports 190 false positives and 109 false negatives.)\n\nThe 1.0 release includes extensive improvements to core type checking, including a novel generics\nsolver and support for extensive bidirectional inference. Of the eight type checkers we tested, only\nty both reported the misspelled key below and accepted the function after we corrected it.\n\nFor a more extreme example, consider satisfies_all, which conjoins an arbitrary number of\npredicates. ty infers that valid_batch needs an input that has a length and yields integers,\naccepting [1, 2, 3] and rejecting iter([1, 2, 3]).\n\nMypy infers Never for the conjoined predicates’ input and rejects both calls. Pyright infers\nSized from large_enough and flags the call to satisfies_all. Pyrefly infers\nSized | Iterable[int] and accepts the iterator, which fails at runtime.\n\nWe’ve also added opt-in return type inference for functions without return annotations. In the\nexample below, decode checks that a log record has an id before returning it. ty carries that\ninformation to the caller, so it accepts record.id.\n\nWith return type inference enabled, Pyright, Pyrefly, and Zuban infer LogRecord and flag the\naccess to record.id. Mypy infers Any.\n\nIn the Beta announcement, we highlighted our best-in-class diagnostic\nsystem and editor integrations. A single ty diagnostic can connect a warning to its cause, even\nacross files, and suggest a fix.\n\nIn 1.0, we also support applying those fixes automatically via ty check --fix.\n\nWhen migrating an existing project, you can now run ty check --add-ignore to add suppression\ncomments in one pass.\n\nAlternatively, configure a\ndiagnostic baseline and run\nty check --update-baseline to record existing diagnostics in a separate file. Commit that file,\nand CI can flag new errors while you fix existing diagnostics over time.\n\nIn our uv and ty integration announcement, we introduced\nsupport for type checking standalone Python scripts that declare their dependencies and Python\nrequirements through inline metadata (PEP 723).\n\nBy integrating with uv, ty can automatically prepare a separate environment for each script,\nallowing you to check an entire project and its scripts together, even when they require different\nPython versions or conflicting dependencies. The same integration powers completions, code\nnavigation, and diagnostics in your editor.\n\nWith the 1.0 release, this integration is available in preview\nand can now be enabled directly in your ty configuration with project-manager.script = \"uv\".\n\nFinally, we’ve made ty stricter in some places and more permissive in others.\n\nFor example, ty now infers more precise types for containers and attributes without annotations,\nenabling it to catch errors even in lightly typed code.\n\nWe've also relaxed some of the rules for narrowing types after checks like isinstance, so common\nPython patterns need fewer casts or annotations.\n\nIn the example below, the parameter is annotated as Term | list[Term]. After\nisinstance(terms, list), we’d usually expect each item to be a Term. But a subclass of Term\ncould also inherit from list[str], so the list could contain strings. ty now accepts term.text\nby default and flags the access when strict generic narrowing is enabled.\n\nThese changes were informed by iterating with users and reviewing real projects in the ecosystem,\nbalancing precision and usefulness with soundness. For users who want to prioritize soundness, ty\noffers opt-in settings like\nstrict generic narrowing\nthat often go beyond what other type checkers support.\n\nSimilarly, ty supports many of the type-enforcement rules popular in mypy’s strict mode, sometimes\ngoing further. For example, ty can warn when a function returns Any, including partially-Any\ncases that mypy’s warn-return-any misses:\n\nty is the most technically ambitious project I have ever worked on. Our goal was to build something\ngenuinely new: an architecture designed around fine-grained incrementality, a novel application of\ngradual and set-theoretic typing to Python, and a foundation for entirely new kinds of developer\ntools. I feel immense pride in the core team as we ship 1.0 (Alex, Andrew, Aria, Carl, David, Dhruv,\nDoug, Ibraheem, Jack, Lérè, Micha, and Shunsuke).\n\nAs in the Beta release, our immediate priority from here is supporting users as they adopt ty.\n\nNow that we’ve built the core of our type checker, though, we can start exploring its broader\napplications: type-aware linting, dead-code elimination, unused dependency analysis, type-aware test\nselection, and more.\n\nWe want to make Python the most productive version of itself. And with ty, we can power an entirely\nnew set of tools and capabilities for the language based on the most sophisticated Python type\nengine in the world.\n\nJust as with Ruff and uv, our commitment from here is that ty will get significantly better every\nweek by working closely with our users. Thank you for building with us.", "url": "https://wpnews.pro/news/ty-1-0", "canonical_source": "https://astral.sh/blog/ty-1.0", "published_at": "2026-12-01 00:00:00+00:00", "updated_at": "2026-12-01 17:15:44.982346+00:00", "lang": "en", "topics": ["developer-tools", "ai-tools", "ai-infrastructure"], "entities": ["Astral", "ty", "OpenAI", "Pyrefly", "Zuban", "mypy", "Pyright", "FastAPI"], "also_reported_by": [], "takeaway": "ty 1.0 ships a novel generics solver, bidirectional inference, opt-in return type inference, and automatic fixes via ty check --fix and ty check --add-ignore, and on the Python typing conformance suite it records 14 false positives and 13 false negatives versus mypy's 190 and 109.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/ty-1-0", "markdown": "https://wpnews.pro/news/ty-1-0.md", "text": "https://wpnews.pro/news/ty-1-0.txt", "jsonld": "https://wpnews.pro/news/ty-1-0.jsonld"}}