Releases: astral-sh/ty
Releases Β· astral-sh/ty
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... |
0.0.17
Release Notes
Released on 2026-02-13.
Bug fixes
- Avoid
Literalpromotion for constrainedTypeVars withLiteralbounds (#23209) - Fix false positives in
TypeVarshadowing checks (#23222)
Core type checking
- Support generic protocols (#21902)
- Perform control-flow analysis in loops (#22794)
- Support
typing.Selfin attribute annotations (#23108) - Support type narrowing in situations with calls to
NoReturnfunctions (#23109) - Support type narrowing and reachability analysis based on
os.namechecks (#23230) - Detect overrides of
Finalclass variables in subclasses (#23180) - Fix bound method access on
None(#23246) - Fix method calls on subclasses of
Any(#23248) - Disallow type variables within PEP-695 type variable bounds and constraints (#22982)
- Emit error for attribute access on union where some elements lack the attribute (#23042)
- Emit error for invalid typevar defaults (#23194)
- Improve display of
ParamSpecs in some situations (#23211)
LSP server
- Add hover and go-to-declaration support for subscript literals (#22837)
- Assign lower completion ranking to deprecated names in auto import (#23188)
- Improve spans of references to submodules imported in an
__init__.py(#21795) - Include conditional symbols (like
datetime.UTC) in auto-import in more cases (#23249) - Support auto-import for symbols in inlay hints (#22111)
- Include overload declarations in find-references (#23215)
Performance
- Avoid
UnionBuilderoverhead when creating a new union from the filtered elements of an existing union (#22352)
Other changes
- Allow discovering dependencies in system Python environments (#22994)
- Apply workspace settings to virtual files (#23228)
- Add support for
--output-format=junit(#22125) - Use a smaller diagnostic range for
inconsistent-mrodiagnostics (#23213)
Contributors
- @carljm
- @BurntSushi
- @charliermarsh
- @Glyphack
- @cetanu
- @AlexWaygood
- @joelostblom
- @Gankra
- @mtshiba
- @MatthewMckee4
- @Hugo-Polloli
- @sharkdp
- @alex
- @dcreager
- @oconnor663
Install ty 0.0.17
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.17/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.17/ty-installer.ps1 | iex"Download ty 0.0.17
0.0.16
Release Notes
Released on 2026-02-10.
Bug fixes
- Allow stringified argument in PEP-613 alias to
Optional(#23200) - Fix fuzzer panic on slice expression in unclosed comprehension (#23146)
- Fix combinatorial explosion due to fixed-length tuple expansion in overload matching (#23190)
- Respect
@no_type_checkwhen combined with other decorators (#23177) - Fix diagnostic location for an incorrect sub-call to a specialized ParamSpec (#23036)
LSP server
- Assign lower completions ranking to deprecated functions and classes (#23089)
- Change goto-def for class constructors to always go to class definition (#23071)
- Ensure diagnostic mode is consistent across projects inside the LSP server (#23121)
- Don't include the class
Fooin autocomplete suggestions when the user is typing outFoo's bases (#23141) - Fix parameter references across files via keyword args (#23012)
- Fix wrong inlay hints for overloaded function arguments (#23179)
- Support diagnostics in newly created files inside neovim (#23095)
- Exclude already-included classes when providing completion suggestions for class bases (#23085)
CLI
- Add support for
TY_OUTPUT_FORMATenvironment variable (#23123) - Fall back to
python3found in$PATHif no environment is found (#22843)
Type checking
- Add
inconsistent-mroautofix to moveGeneric[]to the end of the bases list (#22998) - Add precise return-type inference for
struct.unpack(#22562, #23130) - Disallow TypeVars within ClassVars (#23184)
- Emit diagnostic on unbound call to abstract
@classmethodor@staticmethod(#23182) - Fix false-positive diagnostics when providing the
total=keyword toTypedDictclasses that had PEP-695 type parameters (#23114) - Narrow both left- and right-hand operands where possible (#23084)
- Narrow chained operators (#23093)
- Narrow equality subscripts on either operand (#23104)
- Recognize
__dataclass_transform__to support SQLModel (#23070) - Relax the attribute narrowing condition to support deeper-nested attribute type narrowing (#22440)
- Support constrained TypeVar compatibility across function boundaries (#23103)
- Support comparison methods (
__gt__, etc.) where a parameter is annotated with aLiteraltype (#23100) - Support partially specialized type context (#22748)
- Use type context when inferring constructor argument types (#23139)
- Validate
TypedDictconstructor calls for generic aliases andtype[...]targets (#23113)
Performance
- Conservative narrowing places optimization (#22734)
Contributors
- @rbange
- @rayzeller
- @charliermarsh
- @11happy
- @figsoda
- @mtshiba
- @ibraheemdev
- @ngnpope
- @sakgoyal
- @oconnor663
- @ericmarkmartin
- @Hugo-Polloli
- @Glyphack
- @sharkdp
- @carljm
- @BurntSushi
Install ty 0.0.16
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.16/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.16/ty-installer.ps1 | iex"Download ty 0.0.16
0.0.15
Release Notes
Released on 2026-02-04.
Bug fixes
- Add support for resolving imports of packages installed into Debian/Ubuntu
dist-packagesdirectories (#22466) - Avoid
not-iterablefalse positives when iterating over an instance of an intersection type with only negated elements (#22089) - Fix support for stringized annotations in very large files (#22913)
- Don't emit Liskov diagnostics for methods with mangled names (#23062)
- Enforce that a
Finalsymbol cannot be reassigned even after a conditional binding (#22986) - Fix TypedDict construction from existing TypedDict values (#22904)
- Fix
Selfresolution for classes nested within methods (#22964) - Fix bidirectional inference with PEP 695 union type aliases (#22988)
- Fix edge-case bugs when narrowing tagged unions in
matchstatements (#22870) - Fix false-positive diagnostics when iterating over an instance of an intersection that includes a TypeVar of which the upper bound is a union where the union includes a non-iterable type (#22117)
- Fix lookup of
__contains__to respect descriptors (#23056) - Fix narrowing of
nonlocalvariables with conditional assignments (#22966) - Fix several bugs that could affect
NewTypes ofNewTypes offloat(#22997) - Fix several type narrowing bugs involving PEP-695 type aliases (#22894)
- Fix spurious query cycles in decorated functions with parameter defaults, for improved performance and improved determinism (#23014)
- Fix unary and comparison operators for TypeVars with union bounds (#22925)
- Understand functions as method descriptors even if they are decorated with a decorator annotated as returning a PEP-695 alias to a
Callabletype (#22902) dataclass_transform: Fix visibility of field specifiers when models are nested inside methods (#23069)
LSP server
- Fix hover showing
Unknownfor bareFinalinstance attributes (#23003) - Improve support for goto-type, goto-declaration, hover, and highlighting of string annotations (#22878)
- Include setters and deleters when renaming properties (#22999)
- Show type qualifiers like
Finalin on-hover hints (#23005)
Configuration
- Add new
unused-type-ignore-commentrule (#22790) - Add a mechanism to ignore/warn/select all rules (#22832)
- Support multiple workspace folders in a single ty LSP server instance (#22953)
- Only add
./srcas a search path if./src/__init__.py(i)does not exist (#22851)
Type checking
- Add a diagnostic detecting if a variable is declared as
Finalbut never has any bindings (#23001) - Add a diagnostic detecting overridden comparison dunder methods on
order=Truedataclasses (#22689) - Add a hint to
invalid-argument-typeandinvalid-assignmentdiagnostics if a variable is annotated with a type from thenumbersmodule (#22931, #22938) - Add diagnostic hint on
unresolved-referenceto suggest using "list" instead of "List" (#22827) - Add new diagnostic for invalid dataclass field orders (#19825)
- Allow a subclass method with a positional-only parameter to override a superclass method without that parameter if the parameter in the subclass method has a default value (#23037)
- Allow self-referential imports outside the global scope (#22963)
- Ban
...in odd places inside tuple specializations (#22889) - Ban
Required,NotRequiredandReadOnlyin parameter annotations (#22888) - Ban legacy
TypeVarbounds or constraints from containing type variables (#22949) - Ban multiple unpacked variadic tuples in a
tuplespecialization (#22884) - Detect generic
Callables in the return type of function signatures (#22954) - Detect invalid
isinstance()andissubclass()calls againstTypedDictclasses (#22887) - Detect invalid
issubclass()calls againstProtocolclasses with non-method members (#22896) - Detect invalid attempts to subclass
Protocol[]andGeneric[]simultaneously (#22948) - Emit a diagnostic on incorrect applications of the legacy convention for specifying positional-only parameters (#22943)
- Emit an error if a
TypeVarTupleis used to subscriptGenericorProtocolwithout being unpacked (#22952) - Fallback to metaclass
__getattr__or__getattribute__when looking up attributes on class objects (#22985) - Fix a bug where an overridden type in a dataclass subclass would not be respected if the dataclass subclass field had a default value but the superclass field did not (#22965)
- Improve bidirectional type inference involving PEP-695 type aliases (#22989)
- Improve detection of invalid
NewTypes with generic bases (#22961) - Improve reachability analysis when evaluating the truthiness of expressions that involve variables that may not be bound in all code paths (#22971)
- Improve the error message if
**is used with a non-mapping in the context of a call to an overloaded function (#22921) - Infer
ParamSpecfrom class constructors for callable protocols (#22853) - Move the location of some
invalid-overloaddiagnostics (#22933) - Point to an overload with an invalid
@finaldecorator when emittinginvalid-overloaderrors for invalid@finaldecorators (#22893) - Avoid false positives when iterating over an instance of an intersection with only negated elements by preserving "pure negation" types in descriptor lookups (#22907)
- Promote
Literaltypes when inferring elements for very large unannotated tuples, for improved performance (#22841) - Recognize functions with stub bodies in
Protocolclasses as implicitly abstract (#22838) - Reduce false positives involving heterogeneous dicts by tracking dictionary literal keys as individual places (#22882)
- Reduce false positives when subscripting classes generic over
TypeVarTuples (#22950) - Remove special handling for
Any()inmatchclass patterns (#23011) - Support
type[None]in type expressions (#22892) - Support legacy namespace packages declared using
pkg_resources.declare_namespace(#22987) - Sync vendored typeshed stubs (#23006), Typeshed diff
- Validate signatures of dataclass
__post_init__methods (#22730)
Contributors
0.0.14
Release Notes
Released on 2026-01-26.
Bug fixes
- Consider keyword arguments when unpacking a variadic argument (#22796)
- Fix binary operator false-positive for constrained TypeVars (#22782)
- Fix docstring rendering for literal blocks after doctests (#22676)
- Fix false-positive
unsupported-operatorfor "symmetric" TypeVars (#22756) - Fix panic when overriding a final method using an assignment (#22831)
- Fix unary operator false-positive for constrained TypeVars (#22783)
- Fix generic functions with a generic (ParamSpec) decorator (#22544)
- Fix
memo.changed_atassertion panics (#22498)
LSP server
- Look up attributes on metaclasses for Go to Definition (#22758)
- Suppress type inlay hints for leading-underscore assignments (#22855)
Configuration
- Add
allowed-unresolved-importssetting (#22800)
Other changes
- Add
assert-type-unspellable-subtypediagnostic, for failedassert_type()where the actual type is a subtype of the named type that can't be spelled in a type expression (#22815) - Add a new
empty-bodyreturn code for functions with stub bodies that have non-Nonereturn annotations (#22846) - Add diagnostic disambiguation for different type aliases with the same name (#22852)
- Add support for dict literals and dict() calls as default values for parameters with TypedDict types (#22161)
- Add support for subscripts on intersections (#22654)
- Avoid duplicate syntax errors for
awaitoutside functions (#22826) - Emit an error if the same type parameter appears more than once in a
Generic[]subscript (#22738) - Emit diagnostic for unimplemented abstract method on @Final class (#22753)
- Fix GitLab Code Quality output format for empty diagnostics (#22833)
- Fix assignment in decorated method causing
Unknownfallback (#22778) - Fix false negative when using a non-runtime-checkable protocol in a
matchclass pattern (#22836) - Improve completion rankings for raise-from/except contexts (#22775)
- Improve invalid assignment diagnostics with type context (#22643)
- Improve support for kwarg splats in dictionary literals (#22781)
- Infer
TypedDicttypes with >=1 required key as being always truthy (#22808) - Point to an overload with an invalid
@finaldecoator when emittinginvalid-overloaderrors for invalid@finaldecorators (#22812) - Require both
*argsand**kwargswhen calling aParamSpeccallable (#22820) - Stricter validation of
TypedDictdefinitions (#22811) - Support recursive and stringified annotations in functional
typing.NamedTuples (#22718) - Support solving generics involving PEP 695 type aliases (#22678)
- Use a more lenient fallback type for failed
namedtuple()andNamedTuplecalls (#22765) - Use type context from augmented assignment dunder calls (#22540)
- Check that starred arguments in function calls are iterable (#22805)
Contributors
- @AlexWaygood
- @maifeeulasad
- @RasmusNygren
- @ntBre
- @Imbuzi
- @dhruvmanila
- @ibraheemdev
- @carljm
- @Hugo-Polloli
- @charliermarsh
- @MichaReiser
- @bxff
- @felixscherz
- @denyszhak
Install ty 0.0.14
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.14/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.14/ty-installer.ps1 | iex"Download ty 0.0.14
0.0.13
Release Notes
Released on 2026-01-21.
Bug fixes
- Fix
--force-excludewhen excluding entire directories (#22595) - Fix missing syntax highlighting for aliased import names (#22675)
- Highlight interpolated-parts in t-strings (#22674)
- Fix the inferred MRO of functional namedtuple classes (#22722)
- Make special cases for subscript inference exhaustive, ensuring that the special casing for tuple subscripts is applied when a union of tuples or an alias to a tuple type is subscripted (#22035)
LSP server
- Improve completion suggestions inside class definitions (#22571)
- Improve performance of completions (#22630)
- Remove completion suggestions for redundant re-exports that share the same top-most module (#22581)
Core type checking
- Add basic support for overloads in
ParamSpec(#21946) - Allow
...as a default value for any parameter if the function is in anif TYPE_CHECKINGblock (#22624) - Allow
if type(x) is Ynarrowing for types other than class-literal types (#22729) - Avoid overload errors when detecting dataclass-on-tuple (#22687)
- Avoid reporting overload errors for successful union variants (#22688)
- Ban
NewTypes with generic bases (#22653) - Fix PEP 695 type aliases not expanding in overload resolution (#22589)
- Fix the return type for synthesized
NamedTuple.__new__methods (#22625) - Emit diagnostics for
NamedTuple,TypedDict,EnumorProtocolclasses decorated with@dataclass(#22672) - Emit
invalid-type-formdiagnostics for stringified annotations where the quoted expression is invalid (#22752) - Infer the implicit type of
clsin__new__methods (#22584) - Make
ModuleTypeandobjectattributes available on namespace packages (#22606) - Make
NamedTuple(...)andnamedtuple(...)calls stricter (#22601) - Narrow on bool and byte subscripts (#22684)
- Narrow on negative subscript indexing (#22682)
- Override
__file__tostrwhen applicable on imported modules (#22333) - Add bidirectional inference for comprehensions (#22564)
- Recognize string-literal types as subtypes of
Sequence[Literal[chars]](#22415) - Add right-hand-side narrowing for
if Foo is type(x)expressions (#22608) - Add simple syntactic validation for the right-hand side of PEP-613 type aliases (#22652)
- Add support for passing
typenameandfield_namesby keyword argument tocollections.namedtuple()calls (#22660) - Add support for starred unpacking in class bases (#22591)
- Validate constructor arguments when a class is used as a decorator (#22377)
- Validate field names for
typing.NamedTuple(...)(#22599) - Add diagnostic on overridden
__setattr__and__delattr__in frozen dataclasses (#21430) - Fix unary operators on
NewTypes offloatorcomplex(#22605)
Configuration
- Support overriding
respect-type-ignore-comments(#22615)
Diagnostics
- Don't add a subdiagnostic pointing to the TypeVar definition if the TypeVar is
Self(#22646) - Show final search path instead of "and 1 more paths" (#22776)
- Group
type[]elements together when displaying union types (#22592)
Performance
- Cache
ClassType::nearest_disjoint_base(#22065)
Other changes
- Sync vendored typeshed stubs (#22590, Typeshed diff
Contributors
- @bxff
- @jhartum
- @thejchap
- @AlexWaygood
- @charliermarsh
- @RasmusNygren
- @mswart
- @MatthewMckee4
- @11happy
- @ibraheemdev
- @sinon
- @MichaReiser
- @carljm
- @BurntSushi
- @dhruvmanila
- @oconnor663
- @zanieb
Install ty 0.0.13
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.13/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.13/ty-installer.ps1 | iex"Download ty 0.0.13
| 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](https://github.com/astral-sh/ty/releases... |
0.0.12
Release Notes
Released on 2026-01-14.
Bug fixes
- Avoid panic that could occur when
casting an object to a TypedDict or union of TypedDicts (#22509) - Fix incorrect narrowing for
if type(x) == y(#22531) - Fix stack overflow with recursive type aliases containing tuple types (#22543)
functools.total_ordering: ensure the signatures of generated methods reflect the signature of the user-provided method (#22496)- Support
dataclass_transformas a function call (#22378) - Use the top materialization of classes for
if type(x) is ynarrowing. For example,if type(x) is tuplewill cause the type ofxto be intersected withtuple[object, ...]rather thantuple[Unknown, ...]. (#22553) - Avoid emitting Liskov violations with respect to a grandparent class if such violations could not be fixed without introducing Liskov violations with respect to a parent class (#22484)
- Fix interaction between classmethod, contextmanager, and Self (#22407)
- Check contravariant type variable bounds contravariantly in specialization inference (#22488)
- Fix false positive for bounded type parameters with NewType (#22542)
Type checking
- Add support for dynamic
type()classes (#22291, #22499, #22537, #22480) - Add support for functional
namedtuplecreation (#22327, #22573, #22575, #22574) - Add a diagnostic for non-decorator uses of
final(#22555) - Add diagnostic to catch generic enums (#22482)
- Add diagnostics for
__init_subclass__argument mismatch (#22185) - Add diagnostics to validate
TypeIsandTypeGuarddefinitions (#22300) - Apply type narrowing to walrus targets (#22369)
- Detect invalid
@total_orderingapplications in non-decorator contexts (#22486) - Fix
@Todotype for starred expressions (#22503) - Improve disambiguation of types in diagnostics (#22547)
- Include type parameters in the display for generic
Callabletypes (#22435) - Infer
type[Unknown]for calls totype()when overload evaluation is ambiguous (#22569) - Support assignment to unions of
TypedDicts (#22294) - Use the key and value parameter types as type context for
__setitem__dunder calls (#22148) - Narrow the right-hand side of
==,!=,isandis notconditions when the left-hand side is not narrowable (#22511)
LSP server
- Fix
__file__type in completions to showstrinstead ofstr | Nonewhen the inferred type isstr(#22510) - Improve rendering of ReST directives in docstrings (#22512)
Contributors
Install ty 0.0.12
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.12/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.12/ty-installer.ps1 | iex"Download ty 0.0.12
0.0.11
Release Notes
Released on 2026-01-09.
Bug fixes
- Fix
super()with TypeVar-annotatedselfandclsparameter (#22208) - Only consider fully static pivots when deriving transitive constraints (#22444)
LSP server
- Don't show diagnostics for excluded files (#22455)
- Fix goto definition for relative imports in third-party files (#22457)
- Improve completion ranking based on origin and exact match (#22460)
- Rank top-level module symbols above most other symbols (#22465)
Configuration
- Enable
unused-ignore-commentby default (#22474)
Performance
- Improve
UnionBuilderperformance by changingType::is_subtype_ofcalls toType::is_redundant_with(#22337) - Optimize union building for unions with many enum-literal members (#22363)-
Other changes
Contributors
Install ty 0.0.11
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.11/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.11/ty-installer.ps1 | iex"