Release Notes
Released on 2026-03-05.
Bug fixes
- Avoid stack overflow with recursive typevar (#23652)
- Fix panic on incomplete except handlers (#23708)
- Allow unions of different-length iterables in
*argsunpacking into optional positional parameters (#23124) - Don't replace
Anyattributes withobjectafterisinstancenarrowing (#23725)
LSP server
- Exclude decorators from class/def code folding (#23543)
- Fix handling of non-Python text documents (#23704)
Configuration
- Add
allselector toty.jsonschema (#23721) - Fix precedence of
allselector in TOML configurations (#23723) - Make
allselector case-sensitive (#23713)
Type checking
- Add
invalid-enum-member-annotationlint rule (#23648) - Add a diagnostic for an unused awaitable (#23650)
- Add a diagnostic if a
TypeVaris used to specialize aParamSpec, or vice versa (#23738) - Add more type-variable default validation (#23639)
- Add unbound type variable detection in annotations (#23641)
- Apply narrowing to walrus values (#23687)
- Do not union
Unknowninto unannotated container types (#23718) - Avoid inferring generics with negative intersections (#23750)
- More precise types for
nameandvalueof an enum (#23683) - Better preserve user-provided union order in inferred specializations (#23715)
- Support narrowing in ternary expressions (#23726)
- Validate bare ParamSpec usage in type annotations, and support stringified ParamSpecs as the first argument to
Callable(#23625)
Contributors
- @charliermarsh
- @zsol
- @Gankra
- @MichaReiser
- @AlexWaygood
- @rizzip
- @iksuddle
- @dcreager
- @BurntSushi
- @carljm
- @oconnor663
Install ty 0.0.21
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.21/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.21/ty-installer.ps1 | iex"