Releases: astral-sh/ty
0.0.27
Release Notes
Released on 2026-03-31.
Bug fixes
- Fix panic on debug builds when attempting to provide autocomplete suggestions for
list[int]<CURSOR>()(#24167) - Fix instance-attribute lookup in methods of protocol classes (#24213)
- Fix nested global and nonlocal lookups through forwarding scopes (#24279)
- Fix panic on
list[Annotated[()]](#24303) - Fix stack overflow on
type A = TypeIs[Callable[[], A]](#24245) - Use
_clsas the name of the first argument for synthesizedcollections.namedtupleconstructor methods (#24333)
LSP server
- Fix semantic token classification for properties accessed on instances (#24065)
- Grey out unused bindings in the editor (#23305)
Core type checking
- Add bidirectional type context for TypedDict
get()defaults (#24231) - Add bidirectional type context for TypedDict
pop()defaults (#24229) - Add support for functional TypedDict (#24174, #24331, #24295)
- Ban type qualifiers in PEP-695 type aliases (#24242)
- Enforce
Finalattribute assignment rules for annotated and augmented writes (#23880) - Improve support for
Callabletype context (#23888) - Infer lambda expressions with
Callabletype context (#22633) - Don't incorrectly infer the type of a method as being a singleton type when it's accessed off an instance (#24039)
- Propagate type context through
awaitexpressions (#24256) - Resolve union-likes in emitting union attribute errors (#24263)
- Show the user where the variable was declared as
Finalwhen emitting a diagnostic about aFinalvariable being reassigned (#24194)
Contributors
Install ty 0.0.27
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.27/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.27/ty-installer.ps1 | iex"Download ty 0.0.27
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>0.0.26
Release Notes
Released on 2026-03-26.
Bug fixes
- Prevent "too many cycle iteration" panics in more situations (#24061)
- Fix false positives and false negatives when unpacking a union of tuples into a function call (#23298)
Core type checking
- Add support for
typing.Concatenate(#23689) - Validate the return type of generator functions (#24026)
- Support dataclass field
converters (#23088) - Disallow
Selfin metaclass and static methods (#23231) - Improve call inference for keyword-only
dict()(#24103) - Respect non-explicitly defined
dataclass_transformparams (#24170) - Unconditionally silence diagnostics in unreachable code (#24179)
- Respect terminal-function-call narrowing in global scope (#23245)
Performance
- Fix performance regression for narrowing on a larger
Literaltype(#24185)
Contributors
Install ty 0.0.26
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.26/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.26/ty-installer.ps1 | iex"Download ty 0.0.26
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>0.0.25
Release Notes
Released on 2026-03-24.
Breaking changes
- Support
type:ignore[ty:code]suppressions (#24096)
Bug fixes
- Avoid eager TypedDict diagnostics in
TypedDict | dictunions (#24151) - Fix Salsa panic propagation (#24141)
- Fix folding ranges of comments separated by statements (#24132)
- Fix loop-header reachability cycles in conditional unpacking (#24006)
- Fix subtyping of intersections containing
NewTypes of unions vs. unions (#24087) - Fix untracked reads in Salsa queries that can lead to backdating panics (#24051)
- Prevent tainted loop bindings in cycle normalization (#24143)
- Simplify an intersection of
N & ~TtoNeverifB & ~Twould simplify toNever, whereBis the concrete base type of aNewTypeN(#24086)
LSP
- Preserve blank lines between comments and imports in add-import action (#24066)
Type checking
- Add diagnostic hint for invalid assignments involving invariant generics (#24032)
- Add precisely-typed overloads for
TypedDictupdate (#24101) - Disallow read-only fields in
TypedDictupdates (#24128) - Expand bounded typevars to their upper bounds when evaluating truthiness comparisons between intersections and literal types (#24082)
- Emit
reveal_typediagnostics in unreachable code (#24070) - Improve
isinstance()reachability analysis (#24077) - Improve keyword argument narrowing for nested dictionaries (#24010)
- Infer
yieldexpression types (#23796) - Reduce diagnostic range for
invalid-metaclass(#24145) - Support narrowing for extended walrus targets (#24129)
- Unions/intersections of gradual types should be assignable to
Never(#24056)
Contributors
Install ty 0.0.25
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.25/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.25/ty-installer.ps1 | iex"Download ty 0.0.25
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>0.0.24
Release Notes
Released on 2026-03-19.
Bug fixes
- Ensure
TypedDictsubscripts for unknown keys returnUnknown(#23926) - Fix overflow with recursive
TypeIs(#23784) - Fix variance of frozen dataclass-transform models (#23931)
LSP server
- Improve semantic token classification for attribute access on union types (#23841)
Core type checking
- Improve performance and correctness by avoiding inferring intersection types for call arguments as a result of bidirectional inference (#23933)
- Narrow keyword arguments when unpacking dictionary instances (#23436)
- Discover
/usr/local/libdist-packages on Debian/Ubuntu (#23797) - Sync vendored typeshed stubs (#23963). Typeshed diff
Install ty 0.0.24
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.24/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.24/ty-installer.ps1 | iex"Download ty 0.0.24
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>0.0.23
Release Notes
Released on 2026-03-13.
Bug fixes
- Fix false-positive diagnostics for PEP-604 union annotations on attribute targets on Python 3.9 when
from __future__ import annotationsis active (#23915) dataclass_transform: Respectkw_onlyoverwrites in dataclasses (#23930)- Fix too-many-cycle panics when inferring loop variables with
Literaltypes (#23875)
Server
- Fix folding range classification of lines starting with
#(#23831) - Fix folding ranges for notebooks (#23830)
Core type checking
- Split errors for possibly missing submodules into a new
possibly-missing-submoduleerror code (enabled by default), and makepossibly-missing-attributeignored by default (#23918) - Improve handling of bidirectional inference when (#23844)
- Fix inference of conditionally defined properties (#23925)
Improvements to diagnostics
- Clarify in diagnostics that
from __future__ import annotationsonly stringifies type annotations (#23928)
Performance improvements
- Avoid duplicated work during multi-inference (#23923)
Contributors
Install ty 0.0.23
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.23/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.23/ty-installer.ps1 | iex"Download ty 0.0.23
0.0.22
Release Notes
Released on 2026-03-12.
Bug fixes
- Fix issue where variables could be inferred as
Divergentif they were assigned using tuple unpacking in loops (#23812) - Allow
error = "all"in a rootpyproject.tomlfile to be overridden usingtool.ty.overridesin a subdirectory'spyproject.tomlfile (#23712) - Only unsoundly upcast
type[]types to their constructorCallabletype during assignability checks, not during redundancy/subtyping checks (#23834, #23901) - Fix stack overflow that could occur with certain recursive protocols (#23870)
LSP server
- Improve syntax highlighting by fixing semantic token classification for generic class members in annotations (#23811)
CLI
- Add
ty explain <RULE>CLI command (#23766)
Core type checking
- Add validation for type parameters with defaults after
TypeVarTupleparameters (#23807) - Allow subtypes of
LiteralStringto be narrowed using equality checks (#23794) - Detect invalid partially stringified PEP-604 unions (#23285)
- Disambiguate duplicate-looking overloaded callables in union display (#23907)
- Don't promote module-literal types to
types.ModuleType(#23786) - Improve type context support for
__setitem__dunder calls (#23800) - Infer
t | {"foo": int}asTDiftis an instance of a TypedDicttdwith afoo: intkey (#23806) - Narrow
TtoT & strrather thanstrifTis a constrained TypeVar withstras one of its constraints (#23850) - Promote
NonetoNone | Unknownin invariant contexts (#23790) - Reject
type[Callable]in type annotations (#23753) - Support enum member access through enum instances and members (#23772)
- Eagerly narrow the type associated with keys of heterogeneous dict literals even when a dict literal appears as a subexpression inside a list or tuple literals (#23569)
- Ensure that
T & ~Sis always inferred as a subtype ofUduring generic inference ifTis understood as a subtype ofU(#23728) - Optimize and improve cycle recovery by preventing "tainted" unions in cycle normalization (#23563)
Installer
- Prefer downloading releases from Astral's mirror over GitHub (#2980)
Contributors
Install ty 0.0.22
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://releases.astral.sh/github/ty/releases/download/0.0.22/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://releases.astral.sh/github/ty/releases/download/0.0.22/ty-installer.ps1 | iex"Download ty 0.0.22
0.0.21
Release Notes
Released on 2026-03-05.
Bug fixes
- Avoid stack overflow with recursive typevar (#23652)
- Fix panic on incomplete except handlers (#23708)
- Allow unions of different-length iterables in
*argsunpacking into optional positional parameters (#23124) - Don't replace
Anyattributes withobjectafterisinstancenarrowing (#23725)
LSP server
- Exclude decorators from class/def code folding (#23543)
- Fix handling of non-Python text documents (#23704)
Configuration
- Add
allselector toty.jsonschema (#23721) - Fix precedence of
allselector in TOML configurations (#23723) - Make
allselector case-sensitive (#23713)
Type checking
- Add
invalid-enum-member-annotationlint rule (#23648) - Add a diagnostic for an unused awaitable (#23650)
- Add a diagnostic if a
TypeVaris used to specialize aParamSpec, or vice versa (#23738) - Add more type-variable default validation (#23639)
- Add unbound type variable detection in annotations (#23641)
- Apply narrowing to walrus values (#23687)
- Do not union
Unknowninto unannotated container types (#23718) - Avoid inferring generics with negative intersections (#23750)
- More precise types for
nameandvalueof an enum (#23683) - Better preserve user-provided union order in inferred specializations (#23715)
- Support narrowing in ternary expressions (#23726)
- Validate bare ParamSpec usage in type annotations, and support stringified ParamSpecs as the first argument to
Callable(#23625)
Contributors
- @charliermarsh
- @zsol
- @Gankra
- @MichaReiser
- @AlexWaygood
- @rizzip
- @iksuddle
- @dcreager
- @BurntSushi
- @carljm
- @oconnor663
Install ty 0.0.21
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.21/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.21/ty-installer.ps1 | iex"Download ty 0.0.21
0.0.20
Release Notes
Released on 2026-03-02.
Bug fixes
- Disallow negative narrowing for
isinstance()orissubclass()checks involvingtype[]types (#23598) - Fix binary operations between an instance of a
NewTypeoffloatand an instance ofAny/Unknown(#23620) - Fix bug where ty would think that a
Callablewith a variadic positional parameter could be a subtype of aCallablewith a positional-or-keyword parameter (#23610) - Fix inference of
t.__mro__iftis an instance oftype[Any](#23632) - Fix overloaded callable assignability for unary
Callabletargets (#23277) - Limit recursion depth when displaying self-referential function types (#23647)
- Ensure that
python -m tyworks even when ty was installed into an ephemeral virtual environment (#2852)
LSP server
- Add support for the LSP protocol's "type hierarchy" feature (#23566)
Type checking
- Add more ParamSpec validation for
P.argsandP.kwargs(#23640) - Ban nested
Required/NotRequired, and ban them both outside ofTypedDictfields (#23627) - Detect inconsistent generic base class specializations that appear in the same MRO (#23615)
- Detect invalid uses of
@finalon non-methods (#23604) - Add partial support and validation for
Unpackwhen used with tuple types (#23651) - Recurse into tuples and nested tuples when applying special-cased validation of arguments passed to
isinstance()andissubclass()(#23607) - Reject ellipsis literals in odd places in type/annotation expressions (#23611)
- Reject functions with PEP-695 type parameters that shadow type parameters from enclosing scopes (#23619)
- Reject generic metaclasses parameterized by type variables (#23628)
- Treat
dataclass_transformdataclasses as neither frozen nor non-frozen (#23366) - Validate that type variable defaults don't reference later type parameters or type parameters out of scope (#23623)
Typeshed
- Sync vendored typeshed stubs (#23642). Typeshed diff
Contributors
- @Hugo-Polloli
- @zanieb
- @sharkdp
- @mtshiba
- @carljm
- @charliermarsh
- @sinon
- @BurntSushi
- @oconnor663
- @AlexWaygood
- @zsol
Install ty 0.0.20
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.20/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.20/ty-installer.ps1 | iex"Download ty 0.0.20
0.0.19
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"Download ty 0.0.19
0.0.18
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"Download ty 0.0.18
| File | Platform | Checksum |
|---|---|---|
| ty-aarch64-apple-darwin.tar.gz | Apple Silicon macOS | checksum |
| ty-x86_64-apple-darwin.tar.gz | Intel macOS | checksum |
| ty-aarch64-pc-windows-msvc.zip | ARM64 Windows | checksum |
| ty-i686-pc-windows-msvc.zip | x86 Windows | checksum |
| ty-x86_64-pc-windows-msvc.zip | x64 Windows | checksum |
| ty-aarch64-unknown-linux-gnu.tar.gz | ARM64 Linux | checksum |
| ty-i686-unknown-linux-gnu.tar.gz | x86 Linux | checksum |
| ty-powerpc64-unknown-linux-gnu.tar.gz | PPC64 Linux | checksum |
| ty-powerpc64le-unknown-linux-gnu.tar.gz | PPC64LE Linux | checksum |
| ty-s390x-unknown-linux-gnu.tar.gz | S390x Linux | checksum |
| ty-x86_64-unknown-linux-gnu.tar.gz | x64 Linux | checksum |
| ty-armv7-unknown-linux-gnueabihf.tar.gz | ARMv7 Linux | checksum |
| ty-aarch64-unknown-linux-musl.tar.gz | ARM64 MUSL Linux | checksum |
| ty-i686-unknown-linux-musl.tar.gz | x86 MUSL Linux | checksum |
| ty-x86_64-unknown-linux-musl.tar.gz | x64 MUSL Linux | checksum |
| [ty-arm-unknown-linux-musleabihf.tar.gz](https://github.com/astral-sh/ty/releases/download/0.0.18/ty-arm... |