NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #616 most downloaded on PyPI
An extremely fast Python type checker, written in Rust.
Last release 3 days ago
24 Sep 2026
Ships on a steady schedule
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
1 years old
125 releases · first in 2025
One column per month.
Fix --force-exclude when excluding entire directories
Released on 2026-01-21.
--force-exclude when excluding entire directories (#22595)ParamSpec (#21946)... as a default value for any parameter if the function is in an if TYPE_CHECKING block (#22624)if type(x) is Y narrowing for types other than class-literal types (#22729)NewTypes with generic bases (#22653)NamedTuple.__new__ methods (#22625)NamedTuple, TypedDict, Enum or Protocol classes decorated with @dataclass (#22672)invalid-type-form diagnostics for stringified annotations where the quoted expression is invalid (#22752)cls in __new__ methods (#22584)ModuleType and object attributes available on namespace packages (#22606)NamedTuple(...) and namedtuple(...) calls stricter (#22601)__file__ to str when applicable on imported modules (#22333)Sequence[Literal[chars]] (#22415)if Foo is type(x) expressions (#22608)typename and field_names by keyword argument to collections.namedtuple() calls (#22660)typing.NamedTuple(...) (#22599)__setattr__ and __delattr__ in frozen dataclasses (#21430)NewTypes of float or complex (#22605)respect-type-ignore-comments (#22615)Self (#22646)type[] elements together when displaying union types (#22592)ClassType::nearest_disjoint_base (#22065)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.13/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.13/ty-installer.ps1 | iex"
Avoid panic that could occur when casting an object to a TypedDict or union of TypedDicts
Released on 2026-01-14.
casting an object to a TypedDict or union of TypedDicts (#22509)if type(x) == y (#22531)functools.total_ordering: ensure the signatures of generated methods reflect the signature of the user-provided method (#22496)dataclass_transform as a function call (#22378)if type(x) is y narrowing. For example, if type(x) is tuple will cause the type of x to be intersected with tuple[object, ...] rather than tuple[Unknown, ...]. (#22553)type() classes (#22291, #22499, #22537, #22480)namedtuple creation (#22327, #22573, #22575, #22574)final (#22555)__init_subclass__ argument mismatch (#22185)TypeIs and TypeGuard definitions (#22300)@total_ordering applications in non-decorator contexts (#22486)@Todo type for starred expressions (#22503)Callable types (#22435)type[Unknown] for calls to type() when overload evaluation is ambiguous (#22569)TypedDicts (#22294)__setitem__ dunder calls (#22148)==, !=, is and is not conditions when the left-hand side is not narrowable (#22511)__file__ type in completions to show str instead of str | None when the inferred type is str (#22510)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.12/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.12/ty-installer.ps1 | iex"
Fix super() with TypeVar-annotated self and cls parameter
Released on 2026-01-09.
super() with TypeVar-annotated self and cls parameter (#22208)unused-ignore-comment by default (#22474)UnionBuilder performance by changing Type::is_subtype_of calls to Type::is_redundant_with (#22337)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.11/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.11/ty-installer.ps1 | iex"
Due to an error in our wheel metadata, this release was partially published to PyPI and manually finished. Consequently, PyPI temporarily did not incl
Released on 2026-01-07.
Due to an error in our wheel metadata, this release was partially published to PyPI and manually finished. Consequently, PyPI temporarily did not include all of the artifacts and the GitHub Release was published by a maintainer instead of GitHub Actions. The artifacts from GitHub Actions were used without alteration. The GitHub release attestations for the artifacts are not available for this release.
ParamSpec in overloaded functions (#22416)NewTypes of float (#22105)T when a value has type Unknown | T (#22436)@total_ordering (#22181, #22183)TypedDict class bodies (#22351)len() (#22330)--add-ignore CLI option (#21696)include = ["myscript"] will now check myscript even though it doesn't have a Python extension (#22243)Callable __name__ FAQ directly from unresolved-attribute diagnostic (#22437)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.10/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.10/ty-installer.ps1 | iex"
Emit a diagnostic if a class decorator is not a callable accepting a type
Released on 2026-01-05.
typing.TypeGuard (#20974)__setattr__ as fallback-only (#22014)TypedDict unions with not in (#22349)property in subclasses properties (#22088)TypedDicts in match statements (#22299)x to be inferred as list[int] for x: Iterable[int] = [42] (#21930)Literal type (#22303)class statements (#22110)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.9/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.9/ty-installer.ps1 | iex"
Rename non-subscriptable rule to not-subscriptable
Released on 2025-12-29.
non-subscriptable rule to not-subscriptable (#22193)unsupported-base sub-diagnostic (#22194)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.8/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.8/ty-installer.ps1 | iex"
Fix classification of modules in import x as y for semantic syntax highlighting
Released on 2025-12-24.
import x as y for semantic syntax highlighting (#22175)__delitem__ instead of __getitem__ for del x[k] (#22121)@staticmethod combined with other decorators incorrectly binding self (#22128)Top[Callable[..., object]] (#22145)callable is used in a type expression instead of collections.abc.Callable or typing.Callable (#22180)Callable type (#22182)TypedDict as part of its display (#22174)__delitem__ for TypedDict to allow deleting non-required keys (#22122)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.7/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.7/ty-installer.ps1 | iex"
FIx panic from unexpanded type aliases in implicit tuple aliases
Released on 2025-12-23.
type[T] where T is a type alias to a union of types (#22115)== narrowing for tuples in unions with disjoint types (#22129)ty.configuration and ty.configurationFile options (#22053)diagnosticMode: off to disable diagnostics while retaining Go To Definition, etc. (#22073)type[T@f] being inserted when you double-click on the inlay (#22139)Ctrl+C (#22083)respect-type-ignore-comments configuration option (#22137)__builtins__.pyi (#22021)__get__ (#22155)_fields attribute for NamedTuples (#22163)_replace method for NamedTuples (#22153)TypedDicts (#22104)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.6/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.6/ty-installer.ps1 | iex"
Fix debug-mode server panic when a user typed a class definition by ensuring class arguments are visited in source order for semantic tokens
Released on 2025-12-20.
dict(...) calls in TypedDict contexts (#22113)X on an enum class will be int if X is defined using enum.nonmember in the class definition (#22025)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.5/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.5/ty-installer.ps1 | iex"
Add support for attribute docstrings
Released on 2025-12-18.
from module import submodule (#22042)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.4/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.4/ty-installer.ps1 | iex"
Improve rendering of signatures in hovers
Released on 2025-12-17.
len calls based on argument size (#22026)unsupported-base and invalid-super-argument diagnostics to avoid extremely long lines when encountering verbose types (#22022).pyi files (#22029)**kwargs and recognize metaclass-based transformers as instances of DataclassInstance (#22018)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.3/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.3/ty-installer.ps1 | iex"
This is the first Beta release of ty, which we're now ready to recommend to motivated users for production use. See our blog post for more details.
Released on 2025-12-16.
This is the first Beta release of ty, which we're now ready to recommend to motivated users for production use. See our blog post for more details.
isinstance(…) calls involving type variables (#21999)TypeVar specializations for Callable types (#21551)classmethod-ness through decorators returning Callables (#21958)Callable (#22011)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.2/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.2/ty-installer.ps1 | iex"
Nothing published for this version
Fix panic for stringified comprehensions and boolean expressions in type expression
Released on 2025-12-16.
invalid-method-override diagnostic on method that uses Callable with a ParamSpec (#21934)for-statements (#21979)__qualname__ and other implicit class attributes (#21966)TypeAliasTypes and unbound ParamSpecs/TypeVars (#21960)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.35/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.35/ty-installer.ps1 | iex"
Improve solving of a type variable with an upper bound when that type variable appears as one element in a union type
Released on 2025-12-12.
kw_only=True dataclasses such that only fields declared in the immediate class body are understood as being keyword-only (#21820)@final instance types are disjoint (#21769)@final type[] types are disjoint (#21770)didChange (#21943)cls as class parameter for semantic highlighting (#21944)__all__ for document and workspace symbol requests (#21928)__all__ += submodule.__all__ in auto-import (#21918)cls parameter in @classmethod method bodies (#21685)cls parameter in signatures of @classmethod methods (#21771)TypedDicts (#21784)C is always considered assignable to type[C[Unknown]] if C is a generic class (#21883)NewTypes of float and complex (#21886)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.34/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.34/ty-installer.ps1 | iex"
Fix assignability problem between tuple[Any, ...] and tuple[int, *tuple[int, ...]]
Released on 2025-12-09.
tuple[Any, ...] and tuple[int, *tuple[int, ...]] (#21803)typing_extensions.ParamSpec uses a default parameter (#21839)Annotated subscript (#21837)Final subscript (#21828)*args: Any is involved (#21859)ParamSpec (#21821)reveal_type (#21668)@asynccontextmanager (#21876)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.33/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.33/ty-installer.ps1 | iex"
Provide auto-import completion suggestions for modules in more situations
Released on 2025-12-05.
ParamSpec (#21445)Callable supertype of generic classes (#21798)assert_type diagnostics (#21811)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.32/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.32/ty-installer.ps1 | iex"
Fix incorrect possibly-missing-attribute diagnostics for asyncio imports on Python 3.14
Released on 2025-12-04.
possibly-missing-attribute diagnostics for asyncio imports on Python 3.14 (#21776)pyproject.toml directories as search-paths if module resolution fails (#21745)X = Any rather than X: Any (#21777)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.31/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.31/ty-installer.ps1 | iex"
Fix exhaustiveness checking for match statements over unions of generic instance types
Released on 2025-12-03.
match statements over unions of generic instance types (#21726)override-of-final-method (#21699)dataclasses.dataclass(...)(cls) is called imperatively (#21729)class F(Generic[*Ts]): ... (#21723)typing.Self when binding bound methods (#21754)type[T] and a union type, where T is a type variable in scope (#21740)type[T] and U, where T is a type variable in scope and U is a type variable not in scope (#21766)type[tuple[...]] (#21652)typing_extensions from autocomplete suggestions unless it's really available (#21731)Any or Unknown (#21730)NamedTuple diagnosticsNamedTuple classes that have field names starting with underscores, which is banned at runtime (#21697)NamedTuple attributes (#21717)super() in methods of NamedTuple classes (#21700)invalid-type-arguments diagnostics, show the user where the type variable was defined (#21727)invalid-explicit-override to also cover properties decorated with @override that do not override anything (#21756)@override, @final and Liskov checks in cases where there are multiple reachable definitions (#21767)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.30/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.30/ty-installer.ps1 | iex"
Fix multiple panics due to recursive type definitions
Released on 2025-11-28.
type[T] where T is a type variable (#21650)typing.final (#21646)type[Any] / type[T] and protocols (#21678)typing.TypeAlias) type aliases (#21553)import ... code action for unresolved references (#21629)type in autocompletion suggestions for type[] types (#21670)code:: lang in docstrings (#21665)Never is used in a type expression (#21660)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.29/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.29/ty-installer.ps1 | iex"
Fix panic for unclosed string literal in type annotation position
Released on 2025-11-25.
types.UnionType elements as type expressions (#21531)typing.override (#21627)Callable types when binding self (#21614)typing.Self when checking protocol members (#21569)TypedDict structural assignment (#21467)typing.TypeAlias type aliases (#21394)type[...], like type[C[int]] (#21552)BaseException after raise (#21571)from ...<CURSOR> completions (#21547)DEFINITION modifier when computing semantic tokens (#21521)2 if there's any IO error (#21508)unresolved-import errors for relative imports as well as absolute imports (#21554)NotImplemented is called (#21523)unresolved-attribute to possibly-missing-attribute for submodules that may not be available (#21618)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.28/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.28/ty-installer.ps1 | iex"
Fix panic for cyclic star imports
Released on 2025-11-18.
enum.auto() for enums with non-int mixins, and imprecise inference of enum.auto() for single-member enums (#20541)Final in the class body but have their value assigned in the class's __init__ method (#21158)__get__ for descriptor lookups even when __get__ is called with incorrect arguments (#21424)global a syntax error (#21312)typing.NewType (#21157)Callable in implicit type aliases (#21496)typing.Union in implicit type aliases (#21363)isinstance() and issubclass() narrowing when the second argument is a typing.py stdlib alias (#21391)type[…] and Type[…] in implicit type aliases (#21421)TYPE_CHECKING conditionals (#21449)typing special forms in implicit type aliases (#21433)Annotated instances (#21447)__hash__ semantics and unsafe_hash for dataclasses (#21470)self parameter in its __init__ method (#21325)Literal type such as Literal[42] to its instance supertype (in this case, int) when solving type variables (#21439)__getattr__ available for ModuleType instances (#21450)from imports of submodules in __init__.py(i) (#21173)__init__.py(i) (#21370)from imports in __init__.py(i) files (#21372)from thispackage import y a re-export of y in __init__.pyi (#21387)TYPE_CHECKING blocks prior to 3.10 (#21379)typing.Dict or typing.Callable as the second argument to isinstance() (#21386)float and complex in type annotation positions (#21388)import keyword in autocompletions for from <name> <CURSOR> statements (#21291)as tokens (#21460)import statements (#21484)+1 and -1 (#21368)non-subscriptable diagnostics (#21461)TypedDicts (#21378)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.27/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.27/ty-installer.ps1 | iex"
Language server: For semantic tokens, fix range filtering for tokens starting at the end of the requested range
Released on 2025-11-10.
Divergent types out of intersections types (#21253)--exclude CLI flag and src.exclude config-file setting (#21341)self for decorated methods and properties (#21123)Self (#21335)ParamSpec (#21139)Literals, Optional, and Annotated (#21195, #21296, #21321)dict is not assignable to TypedDict (#21238)None in type expressions (#21263)isinstance() and issubclass() checks that use PEP-604 unions (#21334)Literal types when solving type variables in contravariant positions (#21164, https://github.com/astral-sh/ruff/pull/21171))__new__ methods on instances (#21147)match statements (#21150)@final classes (#21167)__init__ method of a non-dataclass inheriting from a generic dataclass (#21159)typing.Literal with a type alias (#21207)isinstance() and issubclass() calls that use invalid PEP-604 unions for their second argument (#21343)TypedDict key error is about subscript access (#21166)backticks instead of 'quotes' (#21163)site-packages directory from the environment that ty is installed in (#21286), improving the ergonomics of uvx ty check__init__.pyi (#20855)from foo import bar to the foo.bar submodule rather than using the __getattr__ function in foo/__init__.py (in situations where they both exist)(#21260)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.26/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.26/ty-installer.ps1 | iex"
Fix bug where ty would think all types had an __mro__ attribute
Released on 2025-10-29.
__mro__ attribute (#20995)TypeVar definitions (#21059)__len__ when determining the truthiness of an instance of a tuple class or a @final class (#21049)Literal type to its enum-instance supertype (#21060)invalid-argument-type diagnostics where a union type was provided (#21044)type_check_only items last in completions (#20910)import <...> in completions when "label details" isn't supported (#21109)--no-progress option to suppress the rendering of a progress bar (#21063)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.25/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.25/ty-installer.ps1 | iex"
Rename unknown-rule lint to ignore-comment-unknown-rule
Released on 2025-10-23.
unknown-rule lint to ignore-comment-unknown-rule (#20948)Self for unannotated self parameters in methods (#20922)dataclass_transform for base class models (#20783)field_specifiers (#20888)dataclass_transform support for fields with an alias (#20961)Literal type display in some situations (#20928)TypeVar default (#20967)from __future__ import (#20987)TypeVars (#20943)continue and break statements outside loops as syntax errors (#20944)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.24/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.24/ty-installer.ps1 | iex"
Fix handling of dataclass field()s without default values
Released on 2025-10-16.
field()s without default values (#20914)super() calls (#20814, #20843)match pattern value narrowing to use equality semantics (#20882)unresolved-import diagnostics, limit the shown import paths to at most five, unless in verbose mode (#20912)TypedDict construction (#20806)Callables (#20842)Callables as bound-method descriptors in special cases (#20802)Callable dunder members as bound method descriptors (#20860)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.23/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.23/ty-installer.ps1 | iex"
Enforce that typing_extensions must come from a stdlib search path. This fixes a panic that could occur with a confusing backtrace if the extra-paths
Released on 2025-10-10.
typing_extensions must come from a stdlib search path. This fixes a panic that could occur with a confusing backtrace if the extra-paths setting was incorrectly used to point to a virtual environment (#20715)/ in the file system (#20684)--output-format=gitlab in CI environments (#20550)NamedTuple type was disjoint from another type (#20538)typing.Protocol is an instance of _ProtocolMeta (#20488)*args variadic parameter (#20511)__annotate__ (Py3.14+) or __warningregistry__ as a module global (#20154)TypeVar solving and inference of generic typesT if it appears in a union with non-TypeVars (T | None, T | str | None, etc.) (#20749)Literal types should be promoted to instance types (#20776)Self (#20517, #20754)C[T] instead of C[Unknown] for the upper bound of Self (#20479)C[Any] is understood as a subtype of C[object] if C is a covariant generic class (#20592)~T is never considered to be assignable to T where T is a type variable (#20606)Any | (Any & T) to Any (#20593)Any, ensuring that (for example) list[Any] is not considered a subtype of list[Any] (#20650)@overload definitions (#20745)@overload implementationUnknown for the symbol's type when accessed from external scopes (#20664)object.__new__ or object.__init__ (#20521)**kwargs (#20430)dataclass_transform parameters for metaclass-based models (#20780)TypeIs narrowing behaviour closer to ty's narrowing behaviour for isinstance() checks. (#20591)dataclass_transform: Support frozen_default and kw_only_default (#20761)Literal type expression as a key when constructing a TypedDict (#20792)--venv as an alias to --python on the command line (#20718)PYTHONPATH to search paths used for ty's module resolution (#20441, #20490)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.22/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.22/ty-installer.ps1 | iex"
Fix inference of constructor calls to generic classes that have explicitly annotated self parameters in their __init__ methods
self parameters in their __init__ methods (#20325)BoundMethodType::into_callable_type() (#20369)NamedTuple methods such as _make, _asdict and _replace in autocomplete suggestions (#20356)python/ to environment.root if a python/ folder exists in the root of a repository (#20263)ast::Attribute nodes (#20413)Self type variables to the method, not the class (#20366)Callable (#20330)Callable (#20331)object for attribute access on synthesized protocols (#20286)NamedTupleLike._make (#20302)TypeIs invariant in its type argument (#20428)isinstance() (#20256)ParamSpecs and TypeVarTuples (#20239)typing.Self in combination with PEP-695 generic contexts (#20304)Hashable, and similar protocols, equivalently to object for subtyping/assignability (#20284)__new__ as a static method (#20212)TypedDict: Add support for typing.ReadOnly (#20241)yield from expressions inside async functions (#20051)"foo".startswith is not an instance of types.MethodWrapperType (#20317)name and value properties on enum members (#20311)slots=True in dataclasses (#20278)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.21/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.21/ty-installer.ps1 | iex"
Server: Cancel background tasks when shutdown is requested
) (#20017)KW_ONLY sentinel only to local fields (#19986)@dataclass_transform (#20002)import and from ... import statements (#19883)__init__) (#20014)Any (#20079)X must be callable in order to satisfy a member on a protocol P (#20142)Top[] and Bottom[] special forms (#20054)__init_subclass__ (#20190)invalid-assignment error code for invalid assignments to ClassVars (#20156)__class_getitem__ is a classmethod (#20192)TypedDict fixes (#20146)TypedDict (#19874)TypedDict (#19810)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.20/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.20/ty-installer.ps1 | iex"
Fix false-positive diagnostics if a function parameter is annotated with type[P] where P is a protocol class
type[P] where P is a protocol class (#19947)ClassVar members and "subprotocols" that extend other protocols (#19950)if type(x) is C[int] (#19926)TypeErrors resulting from protocol classes illegally inheriting from non-protocol classes (#19941). We previously detected this error, but only when the protocol class illegally inherited from a non-generic class or an unspecialized generic class. We now also detect it when the protocol class inherits from a specialized generic class.NamedTuple semantics improvementsNamedTuple classes (#19899)NamedTuple class to be passed to a function parameter annotated with typing.NamedTuple (#19915)NamedTuple classes where fields without default values illegally follow fields with default values (#19945). This causes TypeError to be raised at runtime.NamedTuple (#19943). This causes TypeError to be raised at runtime.partial in their py.typed files (#19931)site-packages directories in <sys.prefix>/lib64/ as well as <sys.prefix>/lib/ on non-Windows systems (#19978). This change fixes a number of unresolved-import false-positive diagnostics reported by Poetry users.await expressions (#19711)else-branch narrowing for if type(a) is A when A is @final (#19925)typing.Self (#19786)kw_only parameter for dataclasses.dataclass() and dataclasses.field() (#19677)ty.inlayHints are disabled (#19963)NamedTuple, a dataclass or a TypedDict (#19912)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.19/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.19/ty-installer.ps1 | iex"
Support non-generic recursive type aliases that use the `type` statement
type statement (#19805)ty.experimental.rename server setting (#19800)ty.inlayHints.variableTypes server setting (#19780)ty.inlayHints.callArgumentNames server setting) (#19269)NamedTuple instances (#19560)typing.TypedDict in type expressions (#19777)__getattr__ support (#19791)collections.ChainMap, collections.Counter, collections.deque and collections.OrderedDict (#19781)TypedDict keys (#19782)typing.Self is bound by the method, not the class (#19784)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.18/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.18/ty-installer.ps1 | iex"
Always refresh diagnostics after a watched files change
__init__ from generic base class (#19693)__setitem__ (#19645)Generic or Protocol being subscripted with a ParamSpec or TypeVarTuple (#19764)--watch mode (#19729)--watch mode (#19712)async/await, async with and yield from (#19595)async for loops and async iterables (#19634)TypedDicts (#19763)isinstance() truthiness analysis for generic types (#19668)type[tuple[int, str]] as the meta-type of tuple[int, str] (#19741)Generic or Protocol with a ParamSpec or TypeVarTuple (#19749)__contains__ (#19642)Option<TupleType> from infer_tuple_type_expression (#19735)as-patterns in reachability analysis (#19728)__setitem__ and improve __getitem__ related diagnostics (#19578)__getitem__ overloads for tuple subclasses (#19493)TypeVar (#19635)__replace__ for dataclasses (#19545)Display for generic type[] types (#19667)ruff_db (#19698)ty badge (#897)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.17/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.17/ty-installer.ps1 | iex"
Add support for @warnings.deprecated and typing_extensions.deprecated
Callable annotations (#19517)match statements: Fix narrowing and reachability of class patterns with arguments (#19512)Literal[…] annotations with inner subscript expressions (#19489)match statements (#19508)isinstance(…) branches (#19503)__len__ and __bool__ special casing to also cover tuple subclasses (#19289)dataclasses.field (#19553)dataclasses.InitVar (#19527)@warnings.deprecated and typing_extensions.deprecated (#19376)T to satisfy a method member on a protocol unless the method is available on the meta-type of T (#19187)EnumType / EnumMeta (#19481)int or str (#19510)Literal annotations (#19477)Final class attributes (#19457)Final (#19462)Final in function parameter- and return-type annotations (#19480)ClassVar (#19483)del x force a local resolution of x in the current scope (#19389)global (#19381)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.16/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.16/ty-installer.ps1 | iex"
Avoid stale diagnostics for open-files diagnostic mode
Callable types (#19192)__setattr__ call check precedence during attribute assignment (#18347)nonlocal statements (#19112)if TYPE_CHECKING blocks (#19372)typing.Final-qualified symbol (#19178)__setattr__ for frozen dataclasses (#19307)TypedDict types (#19354)global uses if there is no explicit definition in the global scope (#19344)-q/--quiet mode, -qq for silent output mode (#19233)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.15/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.15/ty-installer.ps1 | iex"
Add cycle detection to ty's implementation of disjointness between types, fixing a possible source of stack overflows when analysing recursive types
types module (#19128).
This fixes another possible source of stack overflows.None (#19120).
This means that e.g. object().__str__() now correctly binds the self argument of the __str__
method, as the object type overlaps with None.Namespace, Class, Parameter, SelfParameter,ClsParameter, Variable, Property, Function, Method, Keyword, String, Number, Decorator, BuiltinConstant and TypeParameter.ty.diagnosticMode configuration setting to "workspace".Never / NoReturn are terminal with respect to control flow (#18333)type[] types and Callable types (#19026)ClassVar annotations (#15768)self.x: int (#19048)Final symbols (#19142)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.14/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.14/ty-installer.ps1 | iex"
Fix stack overflows related to mutually recursive protocols
unresolved-reference in staticmethods and classmethods (#18487)Never in hasattr narrowing (#19043)__import__(name) and importlib.import_module(name) (#19008)ScopedExpressionId (#19019)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.13/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.13/ty-installer.ps1 | iex"
Avoid duplicate diagnostic when reporting errors in unpacked assignments
ClassVar or Final parameterized with >1 argument (#18824). These could cause issues when hovering over symbols in an IDE.@staticmethods (#18809)@classmethod-decorated methods. Recognize that assignments in the body of a @staticmethod-decorated method are never instance attributes (#18587)KW_ONLY field (#18731)isinstance() and issubclass() narrowing when the second argument is a union type, intersection type or TypeVar type (#18900)NominalInstanceTypes as disjoint types if attempting to use multiple inheritance with their underlying classes would result in an instance memory layout conflict (#18864)tuple[int, *tuple[str, ...]] (#18600, #18901)from module import <CURSOR> (#18830)src.exclude patterns, for consistency with src.include patterns (#18685)environment.root to accept multiple paths (#18913)src.root setting to environment.root (#18760)--python=<symlink to executable> (#18827)curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.12/ty-installer.sh | sh
powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.12/ty-installer.ps1 | iex"
Your coding agent can read these notes before it upgrades. Set up the MCP server →