Release Notes
Bug fixes
- Fix server panics when hovering over invalid syntax in
Callableannotations (#19517) matchstatements: Fix narrowing and reachability of class patterns with arguments (#19512)- Fix server panics when hovering over illegal
Literal[…]annotations with inner subscript expressions (#19489) - Pass down specialization to generic dataclass bases (#19472)
Server
- Add support for "go to definition" for attribute accesses and keyword arguments (#19417)
- Add support for "go to definition" for import statements (#19428)
- Add support for "document highlights" (#19515)
- Add partial support for "find references" (#19475)
- Prefer the runtime definition, not the stub definition, on a go-to-definition request for a class or function. Currently this is only implemented for definitions originating outside of the stdlib. (#19471)
- Add semantic token support for more identifiers (#19473)
- Avoid rechecking the entire project when a file in the editor is opened or closed (#19463)
Typing semantics and features
- Handle splatted arguments in function calls (#18996)
- Improve place lookup and narrowing in lazy scopes (#19321)
- Add exhaustiveness checking and reachability analysis for
matchstatements (#19508) - Improve reachability analysis for
isinstance(…)branches (#19503) - Make tuple subclass constructors sound (#19469)
- Extend tuple
__len__and__bool__special casing to also cover tuple subclasses (#19289) - Add support for
dataclasses.field(#19553) - Add support for
dataclasses.InitVar(#19527) - Add support for
@warnings.deprecatedandtyping_extensions.deprecated(#19376) - Do not consider a type
Tto satisfy a method member on a protocol unless the method is available on the meta-type ofT(#19187) - Implement expansion of enums into unions of literals (#19382)
- Support iterating over enums (#19486)
- Detect enums if metaclass is a subtype of
EnumType/EnumMeta(#19481) - Infer single-valuedness for enums deriving from
intorstr(#19510) - Detect illegal non-enum attribute accesses in
Literalannotations (#19477) - Disallow assignment to
Finalclass attributes (#19457) - Handle implicit instance attributes declared
Final(#19462) - Disallow
Finalin function parameter- and return-type annotations (#19480) - Disallow illegal uses of
ClassVar(#19483) - Make
del xforce a local resolution ofxin the current scope (#19389) - Perform type narrowing for places marked
global(#19381) - Infer correct types for attribute accesses on intersections with negative parts (#19524)
- Sync vendored typeshed stubs (typeshed diff)
Memory usage optimizations
Contributors
- @sharkdp
- @BurntSushi
- @oconnor663
- @Gankra
- @carljm
- @AlexWaygood
- @MichaReiser
- @dcreager
- @mtshiba
- @UnboundVariable
Install ty 0.0.1-alpha.16
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.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.1-alpha.16/ty-installer.ps1 | iex"