Release Notes
Released on 2026-11-29.
Performance improvements
- Simplify unions containing many string, bytes, or integer literals faster by reusing comparisons with other members, such as the class objects in NumPy’s dtype annotations. (#30994)
- Infer large collections of literals faster when consecutive elements without an expected type widen to the same built-in type, as in the keys or values of Rich’s emoji table. (#30672)
- Index imported dependencies faster by skipping syntax checks and other work used only for diagnostics in files outside the set ty checks. (#30146)
- Reduce cache overhead in the language server and
ty check --watchby avoiding a lock when reusing a parsed module. (#30951) - Check functions annotated
-> Nonefaster by skipping the analysis that determines whether execution can reach an implicit return. (#30987) - Report project-wide diagnostics faster by looking up each diagnostic’s file path once before sorting. (#30982)
- Simplify unions of fixed-length tuples faster by checking earlier for disjoint literals or distinct class objects at matching positions. (#30997)
- Reduce the overhead of comparing ordinary union members by running literal-group simplification only for groups of literals. (#30997)
- Match positional arguments to parameters faster when every remaining parameter has a default and the call has no keyword arguments or unpacking. (#30964)
- Check overloaded methods faster by building their signatures directly as ty specializes each overload for the receiver. (#30972)
- Look up methods on specialized generic classes faster when
Selfappears in multiple parts of the signature. (#30966) - Reduce stack usage when inferring and checking function calls. (#31006)
- Reduce cache lookup overhead for assignability checks and other type comparisons that infer type variables. (#30968)
- Reduce the overhead of solving type constraints when a comparison has a simple yes-or-no answer or involves only a few constraints. (#31023, #30980)
- Analyze generic types such as
list[T]faster by avoiding redundant recursion checks when inspecting their type arguments. (#30783) - Resolve names used as types faster, including imported classes and implicit type aliases, by following imports once when checking what a name refers to. (#31018)
- Reduce the cost of looking up a generic type alias in its original form when ty already has the alias without type arguments. (#30977)
- Resolve names and attributes faster by starting with local bindings and using a direct lookup when a single unconditional binding needs no further narrowing or re-export check. (#30952, #30949)
- Look up names faster in small scopes, such as functions with few parameters and local variables. (#31010)
- Index and look up definitions faster, including the common case where a statement defines a single name. (#30989, #31005)
- Index function parameters more efficiently when the body contains only a docstring,
pass, or..., including stubs with a leading docstring. (#30984) - Reduce the overhead of tracking assignments and declarations through control flow when only a few definitions can reach a use. (#31009, #30971)
- Reduce allocations when scopes in the same file share identical assignment and declaration information. (#31035)
- Reduce the work needed to build the index of conditions that determine which code is reachable. (#30942, #31032)
- Evaluate whether code is reachable faster when the relevant conditions are in the current scope. (#30948)
- Reduce allocations when tracking which names and attributes are defined across branches by reusing up-to-date information and recording undefined entries only when needed. (#31024, #31026)
- Reduce allocations when indexing files by sizing tables for imports and other syntax information up front. (#31031)
- Reduce diagnostic overhead by reusing checks for whether a file is in scope and whether an enclosing function uses
@no_type_check. (#30947) - Skip looking up redundant-condition rules in blocks without
if,assert,while, ormatchstatements. (#30947)
Memory usage improvements
- Use less memory across a project by reserving cache space for dynamically created classes and type aliases only on the definitions that need it. (#30955)
- Use less memory when treating a bound Python method such as
obj.methodas a callable. (#31017) - Use less memory when checking whether a function matches a
Callabletype by comparing their signatures directly. (#25948) - Use less memory to track expressions inferred on their own, including the right-hand sides of assignments. (#28952)
- Use less memory to track unpacking in assignments and comprehensions. (#30975)
Core type checking
- Check generators faster when an implicit
Nonereturn is valid, as withIterator[int]orGenerator[int, None, str | None]. In these cases, ty skips analyzing whether execution reaches the end of the body. (#30992) - Reduce the memory used to cache type-checking results on 64-bit systems by upgrading to Salsa 0.28.7. (#30950)
- Include more cache bookkeeping in reports enabled by
TY_MEMORY_REPORT, which can increase reported memory use. (#30950)
Contributors
Install ty 0.0.113
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.113/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.113/ty-installer.ps1 | iex"Download ty 0.0.113
Verifying GitHub Artifact Attestations
The artifacts in this release have attestations generated with GitHub Artifact Attestations. These can be verified by using the GitHub CLI:
gh attestation verify <file-path of downloaded artifact> --repo astral-sh/tyYou can also download the attestation from GitHub and verify against that directly:
gh attestation verify <file-path of downloaded artifact> --bundle <file-path of downloaded attestation>