Release Notes
Released on 2026-02-20.
Bug fixes
- Support classes dynamically created via
type(...)with cyclic bases (#22792) - Fix incorrect types inferred when unpacking mixed tuples (#23437)
- Fix stack overflow for self-referential
TypeOfin annotations (#23407) - Fix several server panics that could occur when computing semantic tokens for the current file (#23403), #23398, #23401)
LSP server
- Add code folding support (#23393)
- Add warning message when running
ty serverinteractively (#23416) - Exclude test-related symbols from non-first-party packages in auto-import completions (#23252)
- Fix bug where diagnostics could disappear after opening an external file (#23447)
- Remove spurious destination for Go-To Definition on variables defined in a loop (#23391)
- Use the fully qualified name when "baking" an inlay hint into the source code if the scope already contains a variable with the same name as the unqualified name (#23265)
- Resolve TypeVars in
call_signature_detailsparameter types (#23149)
CLI
- Add
--output-formattoty version(#23387)
Configuration
Type checking
- Add a new diagnostic to detect invalid class patterns in
matchstatements (#22939) - Allow
SelfinClassVartype annotations (#23362) - Consider synthesized methods and
ClassVar-qualified declarations when determining whether an abstract method has been overridden in a subclass (#23381) - Add a diagnostic when combining
FinalandClassVar(#23365) - Fix return type of
assert_never(#23389) - Fix
assert_typediagnostic messages (#23342) - Ban PEP-613 type alias values from containing type-qualifier special forms (#23444)
- Infer
LiteralStringforf"{literal_str_a} {literal_str_b}"(#23346) - Infer precise types for bit-shift operations on integer literals (#23301)
- Make
[abstract-method-in-final-class]diagnostics less verbose for classes with many abstract methods (#23379) - Improve diagnostics for abstract
@finalclasses (#23376) - Only perform literal promotion for implicitly inferred literals (#23107)
- Parenthesize callable types when they appear in the return annotation of other callable types (#23327)
- Consider a call to a generic function returning
Neverto terminate control flow (#23419) - Support calls to intersection types (#22469)
- Validate annotated assignments to attributes on self (#23388)
- Treat a bytes-literal type as a subtype of
Sequence[<constituent integers in the bytestring>](#23329) - Allow a string-literal argument to match against an
Iterableparameter in type variable inference. (#23326) - Support narrowing from a
Callabletype returning aTypeGuardtype (#23280)
Performance
- Consider all code paths as being ambiguously reachable in cases with pathologically large control-flow graphs (#23399)
Typeshed
- Sync vendored typeshed stubs (#23279, Typeshed diff)
Contributors
- @toby-bro
- @Hugo-Polloli
- @MatthewMckee4
- @BurntSushi
- @ibraheemdev
- @knutwannheden
- @Glyphack
- @charliermarsh
- @AlexWaygood
- @abhijeetbodas2001
- @carljm
- @sharkdp
Install ty 0.0.18
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.18/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.18/ty-installer.ps1 | iex"