Release Notes
Bug fixes
- Fix inference of constructor calls to generic classes that have explicitly annotated
self
parameters in their__init__
methods (#20325) - Fix a stack overflow when computing completions for recursive types (#20354)
- Fix panic in
BoundMethodType::into_callable_type()
(#20369) - Fix stack overflows in binary comparison inference (#20446)
- Fix many "too many cycle iterations" panics concerning recursive type aliases and/or recursive generics (#20359)
- Fix stack overflow involving subtype checks for recursive type aliases (#20259)
- Fix panic when inferring the type of an infinitely-nested-tuple implicit instance attribute (#20333)
Server
- Add autocomplete suggestions for unimported symbols (#20207, #20439)
- Include generated
NamedTuple
methods such as_make
,_asdict
and_replace
in autocomplete suggestions (#20356)
Configuration
- Automatically add
python/
toenvironment.root
if apython/
folder exists in the root of a repository (#20263)
CLI
Typing semantics and features
- Add support for generic PEP-695 type aliases (#20219)
- Allow annotation expressions to be
ast::Attribute
nodes (#20413) - Allow protocols to participate in nominal subtyping as well as structural subtyping (#20314)
- Attribute access on top/bottom materializations (#20221)
- Bind
Self
type variables to the method, not the class (#20366) - Ensure various special-cased bound methods are understood as assignable to
Callable
(#20330) - Ensure various special-cased builtin functions are understood as assignable to
Callable
(#20331) - Fall back to
object
for attribute access on synthesized protocols (#20286) - Fix signature of
NamedTupleLike._make
(#20302) - Fix subtyping/assignability of function- and class-literal types to callback protocols (#20363)
- Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248)
- Infer more precise types for collection literals (#20360)
- Make
TypeIs
invariant in its type argument (#20428) - Narrow specialized generics using
isinstance()
(#20256) - Proper assignability/subtyping checks for protocols with method members (#20165)
- Reduce false positives for
ParamSpec
s andTypeVarTuple
s (#20239) - Overload evaluation: retry parameter matching for argument type expansion (#20153)
- Simplify unions of enum literals and subtypes thereof (#20324)
- Support "legacy"
typing.Self
in combination with PEP-695 generic contexts (#20304) - Treat
Hashable
, and similar protocols, equivalently toobject
for subtyping/assignability (#20284) - Treat
__new__
as a static method (#20212) TypedDict
: Add support fortyping.ReadOnly
(#20241)- Detect syntax errors stemming from
yield from
expressions inside async functions (#20051) "foo".startswith
is not an instance oftypes.MethodWrapperType
(#20317)- Eliminate definitely-impossible types from union in equality narrowing (#20164)
- Infer more precise types for the
name
andvalue
properties on enum members (#20311) - Initial support for
slots=True
in dataclasses (#20278) - Improve type narrowing in situations involving nested functions (#19932)
- Support type aliases in binary comparison inference (#20445)
- Sync vendored typeshed stubs (#20394). Typeshed diff
Diagnostics
- Improve specialization-error diagnostics (#20326)
Contributors
- @thejchap
- @AlexWaygood
- @mtshiba
- @JelleZijlstra
- @ibraheemdev
- @TaKO8Ki
- @Glyphack
- @ericmarkmartin
- @Renkai
- @sharkdp
- @11happy
- @BurntSushi
- @carljm
- @dhruvmanila
- @github-actions
- @ntBre
Install ty 0.0.1-alpha.21
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.21/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.21/ty-installer.ps1 | iex"