Release Notes
Released on 2026-02-26.
Bug fixes
- Fix panic in diagnostic rendering when attempting to render a code frame pointing to leading whitespace (#23458)
- Fix panics and incorrect inference stemming from incorrectly considering overloads in another file as being associated with a function in the file being checked (#21977)
- Fix panic when attempting to narrow the type of a dictionary key that was assigned using a multi-target assignment, e.g.
x = y = {"a": 1}(#23523) - Fix infinite hang on mutually recursive
TypeAliasTypedefinitions (#23397)
LSP server
- Fix inlay hints for starred unpacking targets (#23454)
Core type checking
- Fix assignability, subtyping and equivalence checks relating to
typing.Generatorprior to Python 3.13 (#23386) - Understand that a scope's control flow terminates after
await foo()iffooreturnstyping.Awaitable[typing.Never]or similar (#23479) - Implement stricter handling of calls to instances of
type[T]types (#23472) - Support basic type narrowing for
case {...}:patterns inmatchstatements (#23462) - Fix bugs that could manifest in incorrect overload evaluation, false-positive complaints regarding
assert_typecalls or false-positiveredundant-castdiagnostics by reimplementing the equivalence type relation as mutual subtyping of top and bottom materializations (#23428) - Fix equality and
__contains__narrowing with PEP-695 type aliases (#23545) - Support
_value_annotations on enum classes (#22228)
Improvements to diagnostics
- Improve diagnostics when attempting to specialize non-generic types (#23516)
- Render subdiagnostics when
--output-format=githubis specified (#23455)
Performance
- Add a cached method for calculating the intersection of two types (#23547)
- Add a cached method for calculating the union of two types (#23565)
- Reduce the threshold above which
Literaltypes in unions are upcasted to nominal-instance types in situations where the union type is recursively defined (#23521) - Control flow: isolate the calculation of "loop header reachability" in a dedicated, cached function (#23520)
Contributors
- @AlexWaygood
- @silamon
- @ibraheemdev
- @Hugo-Polloli
- @charliermarsh
- @knutwannheden
- @oconnor663
- @carljm
- @mtshiba
Install ty 0.0.19
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.19/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.19/ty-installer.ps1 | iex"