Release Notes
Released on 2026-03-02.
Bug fixes
- Disallow negative narrowing for
isinstance()orissubclass()checks involvingtype[]types (#23598) - Fix binary operations between an instance of a
NewTypeoffloatand an instance ofAny/Unknown(#23620) - Fix bug where ty would think that a
Callablewith a variadic positional parameter could be a subtype of aCallablewith a positional-or-keyword parameter (#23610) - Fix inference of
t.__mro__iftis an instance oftype[Any](#23632) - Fix overloaded callable assignability for unary
Callabletargets (#23277) - Limit recursion depth when displaying self-referential function types (#23647)
- Ensure that
python -m tyworks even when ty was installed into an ephemeral virtual environment (#2852)
LSP server
- Add support for the LSP protocol's "type hierarchy" feature (#23566)
Type checking
- Add more ParamSpec validation for
P.argsandP.kwargs(#23640) - Ban nested
Required/NotRequired, and ban them both outside ofTypedDictfields (#23627) - Detect inconsistent generic base class specializations that appear in the same MRO (#23615)
- Detect invalid uses of
@finalon non-methods (#23604) - Add partial support and validation for
Unpackwhen used with tuple types (#23651) - Recurse into tuples and nested tuples when applying special-cased validation of arguments passed to
isinstance()andissubclass()(#23607) - Reject ellipsis literals in odd places in type/annotation expressions (#23611)
- Reject functions with PEP-695 type parameters that shadow type parameters from enclosing scopes (#23619)
- Reject generic metaclasses parameterized by type variables (#23628)
- Treat
dataclass_transformdataclasses as neither frozen nor non-frozen (#23366) - Validate that type variable defaults don't reference later type parameters or type parameters out of scope (#23623)
Typeshed
- Sync vendored typeshed stubs (#23642). Typeshed diff
Contributors
- @Hugo-Polloli
- @zanieb
- @sharkdp
- @mtshiba
- @carljm
- @charliermarsh
- @sinon
- @BurntSushi
- @oconnor663
- @AlexWaygood
- @zsol
Install ty 0.0.20
Install prebuilt binaries via shell script
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.20/ty-installer.sh | shInstall prebuilt binaries via powershell script
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.20/ty-installer.ps1 | iex"