Release Notes
Released on 2025-11-18.
Bug fixes
- Fix panic for cyclic star imports (#21428)
- Fix crashes when using a homebrew Python install (#21405)
- Fix incorrect inference of
enum.auto()for enums with non-intmixins, and imprecise inference ofenum.auto()for single-member enums (#20541) - Fix global symbol lookup from eagerly executed scopes such as comprehensions and classes (#21317)
- Fix false positive for instance attributes that are declared as
Finalin the class body but have their value assigned in the class's__init__method (#21158) - Use the return type of
__get__for descriptor lookups even when__get__is called with incorrect arguments (#21424) - Consider parameters being declared
globala syntax error (#21312)
Type inference
- Support
typing.NewType(#21157) - Support
Callablein implicit type aliases (#21496) - Support
typing.Unionin implicit type aliases (#21363) - Precise inference for generator expressions (#21437)
- Support storing attributes in comprehension scopes (#20856)
- Support
isinstance()andissubclass()narrowing when the second argument is atyping.pystdlib alias (#21391) - Support
type[…]andType[…]in implicit type aliases (#21421) - Support attribute-expression
TYPE_CHECKINGconditionals (#21449) - Support class-arguments for dataclass transformers (#21457)
- Support legacy
typingspecial forms in implicit type aliases (#21433) - Support stringified annotations in value-position
Annotatedinstances (#21447) - Support all parameters of dataclass transforms (#21474)
- Support
__hash__semantics andunsafe_hashfor dataclasses (#21470) - Improve handling of version-specific features of dataclasses (#21453)
- Correctly infer the specialization of a non-invariant PEP-695 generic class that has an annotated
selfparameter in its__init__method (#21325) - Improve use of type context when inferring the result of a generic constructor call (#20933, #21442)
- Improve use of type context when inferring the result of a generic call expression (#21210)
- Improve heuristics used to decide when it is appropriate to "promote" a
Literaltype such asLiteral[42]to its instance supertype (in this case,int) when solving type variables (#21439) - Improve use of type context to infer conditional expressions (#21443)
- Make
__getattr__available forModuleTypeinstances (#21450) - Introduce implicit local variables for
fromimports of submodules in__init__.py(i)(#21173) - Make implicit submodule locals only occur in global scope of an
__init__.py(i)(#21370) - Make implicit submodule locals also occur for absolute
fromimports in__init__.py(i)files (#21372) - Consider
from thispackage import ya re-export ofyin__init__.pyi(#21387) - Allow PEP-604 unions in stubs and
TYPE_CHECKINGblocks prior to 3.10 (#21379) - Ensure annotation/type expressions in stub files are always deferred (#21401, #21456)
- Silence false-positive diagnostics when using
typing.Dictortyping.Callableas the second argument toisinstance()(#21386) - Sync vendored typeshed stubs (#21466). Typeshed diff
LSP server
- Support for notebooks in VS Code (#21175)
- Fix goto-definition for
floatandcomplexin type annotation positions (#21388) - Support goto-definition on call argument inlay hints (#20349)
- Add more keywords to scope-based completions (#21383)
- Add synthetic members to completions on dataclasses (#21446)
- Only suggest the
importkeyword in autocompletions forfrom <name> <CURSOR>statements (#21291) - Suppress completion suggestions following
astokens (#21460) - Suppress invalid suggestions in
importstatements (#21484) - Suppress redundant inlay hints for function args (#21365)
- Suppress some trivial expression inlay hints (#21367)
- Suppress inlay hints for
+1and-1(#21368) - Improve semantic token classification for names (#21399)
- Classify parameter declarations as definitions when computing semantic tokens (#21420)
Diagnostics
- Better invalid-assignment diagnostics (#21476)
- Better concise diagnostic messages (#21498)
- Improve subscript assignment diagnostics (#21411, #21452)
- Improve diagnostic range for
non-subscriptablediagnostics (#21461) - Improve diagnostics for invalid exceptions (#21475)
- Add hyperlinks to rule codes in CLI (#21502)
Performance improvements
- Cache computation of dataclass/NamedTuple/TypedDict fields (#21512)
- Faster subscript assignment checks for (unions of)
TypedDicts (#21378) - Reduce memory allocations for string-literal types (#21497)
Contributors
- @thejchap
- @mtshiba
- @ibraheemdev
- @Gankra
- @charliecloudberry
- @lucach
- @AlexWaygood
- @MichaReiser
- @Glyphack
- @dcreager
- @saada
- @11happy
- @oconnor663
- @MatthewMckee4
- @BurntSushi
- @RasmusNygren
- @sharkdp
Install ty 0.0.1-alpha.27
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.27/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.27/ty-installer.ps1 | iex"