Release Notes
Released on 2025-10-23.
Breaking changes
- Rename
unknown-rulelint toignore-comment-unknown-rule(#20948)
Type inference and diagnostics
- Infer a type of
Selffor unannotatedselfparameters in methods (#20922) - Prefer the declared type over the inferred type for invariant collection literals (#20927)
- Use declared variable types as bidirectional type context for solving type variables (#20796)
- Support
dataclass_transformfor base class models (#20783) - Support dataclass-transform
field_specifiers(#20888) dataclass_transformsupport for fields with analias(#20961)- Add support for legacy namespace packages (#20897)
- Add suggestion to "unknown rule" diagnostics (#20948)
- Improve error messages for "unresolved attribute" diagnostics (#20963)
- Avoid unnecessarily widening generic specializations (#20875)
- Truncate
Literaltype display in some situations (#20928)
Bug fixes
- Fix panic involving cyclic
TypeVardefault (#20967) - Fix panic involving ever-growing default types (#20991)
- Fix panic involving infinitely expanding implicit attribute types (#20988)
- Fix autocomplete suggestions when the cursor is at the end of a file (#20993)
- Fix inconsistent highlighting of self (#20986)
- Fix out-of-order semantic token for function with regular argument after kwargs (#21013)
- Fix panic on recursive class definitions in a stub that use constrained type variables (#20955)
- Fix panic when attempting to validate the members of a protocol that inherits from a protocol in another module (#20956)
- Fix rare hang relating to multithreading (#21038)
- Fix non-deterministic overload function inference (#20966)
- Fix auto-import edits made by autocompletions for files with an existing
from __future__import (#20987)
LSP server
- Support goto-definition for binary and unary operators (#21001)
- Support goto-definition on vendored typeshed stubs (#21020)
- Provide completions on
TypeVars (#20943) - Display variance when hovering over type variables (#20900)
- Avoid sending an unnecessary "clear diagnostics" message for clients supporting pull diagnostics. (#20989)
Other changes
- Report
continueandbreakstatements outside loops as syntax errors (#20944)
Contributors
Install ty 0.0.1-alpha.24
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.24/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.24/ty-installer.ps1 | iex"