Release Notes
Bug fixes
- Add cycle detection to ty's implementation of disjointness between types, fixing a possible source of stack overflows when analysing recursive types (#19139)
- Don't allow first-party code to shadow the stdlib
types
module (#19128).
This fixes another possible source of stack overflows. - Fix descriptor lookups for most types that overlap with
None
(#19120).
This means that e.g.object().__str__()
now correctly binds theself
argument of the__str__
method, as theobject
type overlaps withNone
.
Server
- Filter a symbol from a stub file in autocomplete suggestions if it is an implementation detail of the stub (#19121)
- Add initial support for semantic tokens (#19108).
This feature allows editors to apply more advanced syntax highlighting. Currently, the supported tokens are:Namespace
,Class
,Parameter
,SelfParameter
,ClsParameter
,Variable
,Property
,Function
,Method
,Keyword
,String
,Number
,Decorator
,BuiltinConstant
andTypeParameter
. - Initial support for workspace diagnostics (#18939).
Enable this feature by setting thety.diagnosticMode
configuration setting to"workspace"
. - Use Python syntax highlighting in on-hover content (#19082)
Typing semantics and features
- Understand that calls to functions returning
Never
/NoReturn
are terminal with respect to control flow (#18333) - Add subtyping between
type[]
types andCallable
types (#19026) - Support bare
ClassVar
annotations (#15768) - Understand that two protocols with equivalent method members are equivalent (#18659)
- Support declared-only instance attributes such as
self.x: int
(#19048) - Sync vendored typeshed stubs (#19174): typeshed diff
- Use the inferred type as the declared type for bare
Final
symbols (#19142)
Contributors
- @iyakushev
- @MatthewMckee4
- @zanieb
- @sharkdp
- @UnboundVariable
- @abhijeetbodas2001
- @github-actions
- @dhruvmanila
- @AlexWaygood
- @carljm
- @CodeMan62
Install ty 0.0.1-alpha.14
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.14/ty-installer.sh | sh
Install prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.14/ty-installer.ps1 | iex"