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
- @charliermarsh
- @stefanvanburen
- @ibraheemdev
- @abhijeetbodas2001
- @MichaReiser
- @dcreager
- @PrettyWood
- @sharkdp
- @oconnor663
- @Feiyang472
- @denyszhak
- @mtshiba
- @AlexWaygood
- @11happy
- @BurntSushi
- @carljm
- @Gankra
- @MentalMegalodon
- @thejchap
Install ty 0.0.15
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.15/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.15/ty-installer.ps1 | iex"