Skip to content

Releases: astral-sh/ty

0.0.1-alpha.27

18 Nov 21:56
26d7b68

Choose a tag to compare

0.0.1-alpha.27 Pre-release
Pre-release

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-int mixins, and imprecise inference of enum.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 Final in 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 global a syntax error (#21312)

Type inference

  • Support typing.NewType (#21157)
  • Support Callable in implicit type aliases (#21496)
  • Support typing.Union in implicit type aliases (#21363)
  • Precise inference for generator expressions (#21437)
  • Support storing attributes in comprehension scopes (#20856)
  • Support isinstance() and issubclass() narrowing when the second argument is a typing.py stdlib alias (#21391)
  • Support type[…] and Type[…] in implicit type aliases (#21421)
  • Support attribute-expression TYPE_CHECKING conditionals (#21449)
  • Support class-arguments for dataclass transformers (#21457)
  • Support legacy typing special forms in implicit type aliases (#21433)
  • Support stringified annotations in value-position Annotated instances (#21447)
  • Support all parameters of dataclass transforms (#21474)
  • Support __hash__ semantics and unsafe_hash for 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 self parameter 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 Literal type such as Literal[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 for ModuleType instances (#21450)
  • Introduce implicit local variables for from imports 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 from imports in __init__.py(i) files (#21372)
  • Consider from thispackage import y a re-export of y in __init__.pyi (#21387)
  • Allow PEP-604 unions in stubs and TYPE_CHECKING blocks prior to 3.10 (#21379)
  • Ensure annotation/type expressions in stub files are always deferred (#21401, #21456)
  • Silence false-positive diagnostics when using typing.Dict or typing.Callable as the second argument to isinstance() (#21386)
  • Sync vendored typeshed stubs (#21466). Typeshed diff

LSP server

  • Support for notebooks in VS Code (#21175)
  • Fix goto-definition for float and complex in 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 import keyword in autocompletions for from <name> <CURSOR> statements (#21291)
  • Suppress completion suggestions following as tokens (#21460)
  • Suppress invalid suggestions in import statements (#21484)
  • Suppress redundant inlay hints for function args (#21365)
  • Suppress some trivial expression inlay hints (#21367)
  • Suppress inlay hints for +1 and -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-subscriptable diagnostics (#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

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 | sh

Install 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"

Download ty 0.0.1-alpha.27

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows [che...
Read more

0.0.1-alpha.26

10 Nov 18:03
b225fd8

Choose a tag to compare

0.0.1-alpha.26 Pre-release
Pre-release

Release Notes

Released on 2025-11-10.

Bug fixes

  • Language server: For semantic tokens, fix range filtering for tokens starting at the end of the requested range (#21193)
  • Fix panic due to simplifying Divergent types out of intersections types (#21253)
  • Fix merging of --exclude CLI flag and src.exclude config-file setting (#21341)

Type inference

  • Infer type of self for decorated methods and properties (#21123)
  • Add support for properties that return Self (#21335)
  • Understand legacy and PEP 695 ParamSpec (#21139)
  • Type inference for comprehensions (#20962)
  • Reachability and narrowing for enum methods (#21130)
  • Implicit type aliases: Support for PEP 604 unions, Literals, Optional, and Annotated (#21195, #21296, #21321)
  • dict is not assignable to TypedDict (#21238)
  • Allow values of type None in type expressions (#21263)
  • Add narrowing for isinstance() and issubclass() checks that use PEP-604 unions (#21334)
  • Do not promote Literal types when solving type variables in contravariant positions (#21164, astral-sh/ruff#21171))
  • Fix lookup of __new__ methods on instances (#21147)
  • Fix narrowing of generic classes in class patterns for match statements (#21150)
  • Improve understanding of disjointness for @final classes (#21167)
  • Fix the inferred signature of the synthesized __init__ method of a non-dataclass inheriting from a generic dataclass (#21159)
  • Improve exhaustiveness analysis for type variables with bounds or constraints (#21172)
  • Prefer exact matches when solving constrained type variables (#21165)
  • Simplify unions containing multiple type variables during inference (#21275)
  • Use the declared attribute type when inferring union attribute assignments (#21170)
  • Sync vendored typeshed stubs (#21178). Typeshed diff
  • Use declared attribute types as type context when solving type variables (#21143)
  • Don't union in the inferred type of a parameter's default value when inferring the type of an annotated parameter (#21208)
  • Support subscripting typing.Literal with a type alias (#21207)

LSP server

  • Don't provide completions when in a class or function definition (#21146)
  • For autocompletions, favor symbols defined in the current file over auto-imported symbols (#21194) and builtin symbols (#21285)

Diagnostics

  • Add diagnostics for isinstance() and issubclass() calls that use invalid PEP-604 unions for their second argument (#21343)
  • Don't assume in diagnostic messages that a TypedDict key error is about subscript access (#21166)

Other changes

  • Consistently wrap tokens in parser diagnostics in backticks instead of 'quotes' (#21163)
  • Discover the site-packages directory from the environment that ty is installed in (#21286), improving the ergonomics of uvx ty check
  • Support implicit imports of submodules in __init__.pyi (#20855)
  • Use "cannot" consistently over "can not" in diagnostics (#21255)
  • Resolve 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)

Contributors

Install ty 0.0.1-alpha.26

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.26/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.26/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.26

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ty-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ty-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
[ty-i686-unknown-linux-musl.tar.gz](https://github.com/astral-sh/ty/releases/download/0.0.1-...
Read more

0.0.1-alpha.25

29 Oct 19:41
3abd4c9

Choose a tag to compare

0.0.1-alpha.25 Pre-release
Pre-release

Release Notes

Released on 2025-10-29.

Bug fixes

  • Fix bug where ty would think all types had an __mro__ attribute (#20995)
  • Fix rare panic with highly cyclic TypeVar definitions (#21059)
  • Fix infinite recursion with generic type aliases (#20969)
  • Add missing newline before first diagnostic in CLI output (#21058)
  • Make the ty server's auto-import feature skip symbols in the current module (#21100)
  • Don't provide goto-definition for definitions which are not reexported in builtins (#21127)
  • Avoid duplicate diagnostics during multi-inference of standalone expressions (#21056)

Type inference and diagnostics

  • Use constructor parameter types as context to inform solving type variables (#21054)
  • Consider __len__ when determining the truthiness of an instance of a tuple class or a @final class (#21049)
  • Delegate truthiness inference of an enum Literal type to its enum-instance supertype (#21060)
  • Improve invalid-argument-type diagnostics where a union type was provided (#21044)

LSP server

  • Suggest type_check_only items last in completions (#20910)
  • Render import <...> in completions when "label details" isn't supported (#21109)
  • Update workspace diagnostic progress every 50ms (#21019)

CLI

  • Add --no-progress option to suppress the rendering of a progress bar (#21063)

Contributors

Install ty 0.0.1-alpha.25

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.25/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.25/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.25

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ty-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ty-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
ty-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
ty-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
ty-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
ty-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

0.0.1-alpha.24

23 Oct 13:34
1fee7da

Choose a tag to compare

0.0.1-alpha.24 Pre-release
Pre-release

Release Notes

Released on 2025-10-23.

Breaking changes

  • Rename unknown-rule lint to ignore-comment-unknown-rule (#20948)

Type inference and diagnostics

  • Infer a type of Self for unannotated self parameters 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_transform for base class models (#20783)
  • Support dataclass-transform field_specifiers (#20888)
  • dataclass_transform support for fields with an alias (#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 Literal type display in some situations (#20928)

Bug fixes

  • Fix panic involving cyclic TypeVar default (#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 continue and break statements 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 | sh

Install 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"

Download ty 0.0.1-alpha.24

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ty-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ty-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
ty-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
ty-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
ty-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
ty-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

0.0.1-alpha.23

16 Oct 18:19
5c51b84

Choose a tag to compare

0.0.1-alpha.23 Pre-release
Pre-release

Release Notes

Released on 2025-10-16.

Bug fixes

  • Fix handling of dataclass field()s without default values (#20914)
  • Fix false-positive diagnostics on super() calls (#20814, #20843)
  • Fix match pattern value narrowing to use equality semantics (#20882)
  • Fix "missing root" panic when handling completion requests (#20917)
  • Fix overwriting of declared base class attributes through undeclared subclass members (#20764)
  • Fix runaway execution time for mutually referential instance attributes (#20645)

CLI

  • For unresolved-import diagnostics, limit the shown import paths to at most five, unless in verbose mode (#20912)
  • Write files that are slow to type check to log output (#20836)
  • Remove "pre-release software" warning (#20817)

LSP server

  • Improve ranking of autocomplete suggestions (#20807)

Type inference and diagnostics

  • Use return type annotations as context for bidirectional type inference (#20528)
  • Use bidirectional type context for TypedDict construction (#20806)
  • Add support for unpacking of heterogeneous tuples in unions (#20377)
  • Add a new diagnostic for generic classes that reference typevars from an enclosing scope (#20822)
  • Add hint when accessing standard library module attributes that are not available on the configured Python version (#20909)
  • Treat functions, methods, and dynamic types as function-like Callables (#20842)
  • Treat Callables as bound-method descriptors in special cases (#20802)
  • Treat Callable dunder members as bound method descriptors (#20860)
  • Sync vendored typeshed stubs (#20876). Typeshed diff

Performance improvements

  • Improve performance by caching union simplification type relations (#20477)

Contributors

Install ty 0.0.1-alpha.23

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.23/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.23/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.23

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ty-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ty-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
ty-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
ty-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
ty-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
ty-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

0.0.1-alpha.22

10 Oct 13:08
2f3190d

Choose a tag to compare

0.0.1-alpha.22 Pre-release
Pre-release

Release Notes

Released on 2025-10-10.

Bug fixes

  • 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 setting was incorrectly used to point to a virtual environment (#20715)
  • Fix server panic when opening a project located at / in the file system (#20684)
  • Fix panics when using --output-format=gitlab in CI environments (#20550)
  • Fix stack overflows that could occur when attempting to determine if a recursive NamedTuple type was disjoint from another type (#20538)
  • Fix panics in type inference when legacy TypeVars had bounds, constraints, or defaults that cyclically referred back to the TypeVar definition (directly or indirectly) (#20598)
  • Fix situations where a panic during resolution of type-checker query cycles would manifest in a hang (#20577)
  • When analyzing a .py file, do not error if there's also a .pyi for that module (#20461)
  • Recognise that the runtime object typing.Protocol is an instance of _ProtocolMeta (#20488)
  • Fix logic that attempted to determine whether a user had explicitly activated a Conda environment, which has implications for the search paths ty uses for module resolution (#20675)
  • Fix false negatives when iterables with the wrong type are unpacked into a function with a *args variadic parameter (#20511)

Support for Python 3.14

  • Use 3.14 as the default version (#20725, #20759, #20760)
  • Annotations are deferred by default for 3.14+ (#20799)
  • Fix false positives when accessing __annotate__ (Py3.14+) or __warningregistry__ as a module global (#20154)

Improvements to TypeVar solving and inference of generic types

  • Improve solving of a type variable T if it appears in a union with non-TypeVars (T | None, T | str | None, etc.) (#20749)
  • More precise type inference for dictionary literals (#20523)
  • When solving type variables, use type context to inform whether Literal types should be promoted to instance types (#20776)
  • Use annotated parameters as type context when solving type variables (#20635)
  • Correctly infer the return type of method calls when the method is annotated as returning Self (#20517, #20754)
  • Use type context for inference of generic function calls (#20476)
  • Use C[T] instead of C[Unknown] for the upper bound of Self (#20479)

Improvements to assignability, subtyping, and union simplification

  • Fix overly strict assignability implementation for intersections with negated gradual elements (#20773)
  • Ensure that C[Any] is understood as a subtype of C[object] if C is a covariant generic class (#20592)
  • Ensure that ~T is never considered to be assignable to T where T is a type variable (#20606)
  • Improve assignability/subtyping between two protocol types (#20368)
  • Simplify Any | (Any & T) to Any (#20593)
  • Optimise and generalise union/intersection simplification (#20602)
  • Make protocol satisfiability checks more principled when a protocol has a method member that is generic over type variables scoped to the function (#20568)
  • Fix subtyping of invariant generics specialized with Any, ensuring that (for example) list[Any] is not considered a subtype of list[Any] (#20650)

Server

  • Add LSP debug information command (#20379)
  • Add support for inlay hints on attribute assignment (#20485)

Improvements to diagnostics

  • Improve diagnostics when a positional-only parameter is passed using a keyword argument (#20495)
  • Improve disambiguations of class names in diagnostics (#20603, #20756)
  • Improve diagnostics for bad @overload definitions (#20745)
  • Truncate type display for long unions in some situations (#20730)
  • Rename "possibly unbound" diagnostics to "possibly missing" (#20492)

Improvements to enum support

  • Allow multiple aliases to point to the same member (#20669)
  • implement auto() for StrEnum (#20524)

Improvements to ty's @overload implementation

  • Support single-starred argument for overload call (#20223)
  • Filter overloads using variadic parameters (#20547)

Other typing semantics and features

  • Do not union the inferred type of a module-global symbol with Unknown for the symbol's type when accessed from external scopes (#20664)
  • Ensure that class objects are understood as callable even if they do not override object.__new__ or object.__init__ (#20521)
  • Add support for **kwargs (#20430)
  • Ensure first-party module-resolution search paths always appear in a sensible order (#20629)
  • Respect dataclass_transform parameters for metaclass-based models (#20780)
  • Sync vendored typeshed stubs (#20658). Typeshed diff
  • Bring ty's TypeIs narrowing behaviour closer to ty's narrowing behaviour for isinstance() checks. (#20591)
  • dataclass_transform: Support frozen_default and kw_only_default (#20761)
  • Allow any string Literal type expression as a key when constructing a TypedDict (#20792)
  • Add --venv as an alias to --python on the command line (#20718)
  • Add search paths listed in PYTHONPATH to search paths used for ty's module resolution (#20441, #20490)

Contributors

Install ty 0.0.1-alpha.22

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.22/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.22/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.22

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
[ty-aa...
Read more

0.0.1-alpha.21

19 Sep 06:54
ef52a19

Choose a tag to compare

0.0.1-alpha.21 Pre-release
Pre-release

Release Notes

Bug fixes

  • Fix inference of constructor calls to generic classes that have explicitly annotated self parameters in their __init__ methods (#20325)
  • Fix a stack overflow when computing completions for recursive types (#20354)
  • Fix panic in BoundMethodType::into_callable_type() (#20369)
  • Fix stack overflows in binary comparison inference (#20446)
  • Fix many "too many cycle iterations" panics concerning recursive type aliases and/or recursive generics (#20359)
  • Fix stack overflow involving subtype checks for recursive type aliases (#20259)
  • Fix panic when inferring the type of an infinitely-nested-tuple implicit instance attribute (#20333)

Server

  • Add autocomplete suggestions for unimported symbols (#20207, #20439)
  • Include generated NamedTuple methods such as _make, _asdict and _replace in autocomplete suggestions (#20356)

Configuration

  • Automatically add python/ to environment.root if a python/ folder exists in the root of a repository (#20263)

CLI

  • Add GitHub output format (#20358)
  • Add GitLab output format (#20155)

Typing semantics and features

  • Add support for generic PEP-695 type aliases (#20219)
  • Allow annotation expressions to be ast::Attribute nodes (#20413)
  • Allow protocols to participate in nominal subtyping as well as structural subtyping (#20314)
  • Attribute access on top/bottom materializations (#20221)
  • Bind Self type variables to the method, not the class (#20366)
  • Ensure various special-cased bound methods are understood as assignable to Callable (#20330)
  • Ensure various special-cased builtin functions are understood as assignable to Callable (#20331)
  • Fall back to object for attribute access on synthesized protocols (#20286)
  • Fix signature of NamedTupleLike._make (#20302)
  • Fix subtyping/assignability of function- and class-literal types to callback protocols (#20363)
  • Implement the legacy PEP-484 convention for indicating positional-only parameters (#20248)
  • Infer more precise types for collection literals (#20360)
  • Make TypeIs invariant in its type argument (#20428)
  • Narrow specialized generics using isinstance() (#20256)
  • Proper assignability/subtyping checks for protocols with method members (#20165)
  • Reduce false positives for ParamSpecs and TypeVarTuples (#20239)
  • Overload evaluation: retry parameter matching for argument type expansion (#20153)
  • Simplify unions of enum literals and subtypes thereof (#20324)
  • Support "legacy" typing.Self in combination with PEP-695 generic contexts (#20304)
  • Treat Hashable, and similar protocols, equivalently to object for subtyping/assignability (#20284)
  • Treat __new__ as a static method (#20212)
  • TypedDict: Add support for typing.ReadOnly (#20241)
  • Detect syntax errors stemming from yield from expressions inside async functions (#20051)
  • "foo".startswith is not an instance of types.MethodWrapperType (#20317)
  • Eliminate definitely-impossible types from union in equality narrowing (#20164)
  • Infer more precise types for the name and value properties on enum members (#20311)
  • Initial support for slots=True in dataclasses (#20278)
  • Improve type narrowing in situations involving nested functions (#19932)
  • Support type aliases in binary comparison inference (#20445)
  • Sync vendored typeshed stubs (#20394). Typeshed diff

Diagnostics

  • Improve specialization-error diagnostics (#20326)

Contributors

Install ty 0.0.1-alpha.21

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.21/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.21/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.21

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux [checksum](https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.21/ty-x86_64-unkno...
Read more

0.0.1-alpha.20

03 Sep 12:36
f41f00a

Choose a tag to compare

0.0.1-alpha.20 Pre-release
Pre-release

Release Notes

Bug fixes

  • Server: Cancel background tasks when shutdown is requested (#20039)
  • Server: Close signature help after ) (#20017)
  • Server: Fix incorrect docstring in call signature completion (#20021)
  • Fix 'too many cycle iterations' for unions of literals (#20137)
  • Fix namespace packages that behave like partial stubs (#19994)
  • Fix server hang (unchanged diagnostics) when changing file on Windows (#19991)
  • Apply KW_ONLY sentinel only to local fields (#19986)
  • Ignore field specifiers when not specified in @dataclass_transform (#20002)

Server

  • Add completion support for import and from ... import statements (#19883)
  • Add type as detail to completion items (#20047)
  • Ask the LSP client to watch all project search paths (#19975)
  • Fix incorrect inlay hint type (#20044)
  • Update goto definition, goto declaration and hover to consider constructor method (__init__) (#20014)
  • Add docstrings to completions based on type (#20008)
  • Fix goto targets for keyword arguments in nested function calls (#20013)
  • Introduce multiline pretty printer to render function signatures across multiple lines (#19979)

Configuration

  • Distinguish base conda from child conda (#19990)

Typing semantics and features

  • Add support for PEP 750: t-strings (#20085)
  • Add support for PEP 800: Disjoint bases (#20084)
  • Add precise inference for unpacking a TypeVar if the TypeVar has an upper bound with a precise tuple spec (#19985)
  • Add precise iteration and unpacking inference for string literals and bytes literals (#20023)
  • Completely ignore typeshed's stub for Any (#20079)
  • Enforce that an attribute on a class X must be callable in order to satisfy a member on a protocol P (#20142)
  • Evaluate static truthiness of non-definitely-bound symbols to "ambiguous" (#19579)
  • Fix the inferred interface of specialized generic protocols (#19866)
  • Infer slightly more precise types for comprehensions (#20111)
  • Disable boundness analysis for implicit instance attributes (#20128)
  • Add Top[] and Bottom[] special forms (#20054)
  • Preserve qualifiers when accessing attributes on unions/intersections (#20114)
  • Strict validation of protocol members (#17750)
  • Support __init_subclass__ (#20190)
  • Unpack variadic argument type in specialization (#20130)
  • Use invalid-assignment error code for invalid assignments to ClassVars (#20156)
  • Use specialized parameter type for overload filter (#19964)
  • __class_getitem__ is a classmethod (#20192)
  • Add cycle detection for find_legacy_typevars (#20124)
  • Add support for cyclic legacy generic protocols (#20125)
  • Don't eagerly unpack aliases in user-authored unions (#20055)
  • Don't mark entire type-alias scopes as Deferred (#20086)
  • Ensure union normalization really normalizes (#20147)
  • Improve cycle-detection coverage for apply_type_mapping (#20159)
  • Linear variance inference for PEP-695 type parameters (#18713)
  • Minor TypedDict fixes (#20146)
  • Typecheck dict methods for TypedDict (#19874)
  • Validate constructor call of TypedDict (#19810)
  • Sync vendored typeshed stubs (#20031, #20083, #20188) Typeshed diff

Diagnostics

  • Add search paths info to unresolved import diagnostics (#20040)
  • Better error message for attempting to assign to a read-only property (#20150)
  • Improve diagnostics for bad calls to functions (#20022)
  • Improve disambiguation of types via fully qualified names (#20141)
  • Print diagnostics with fully qualified name to disambiguate some cases (#19850)

Performance

  • Avoid unnecessary argument type expansion (#19999)
  • Limit argument expansion size for overload call evaluation (#20041)
  • Optimize TDD atom ordering (#20098)

Contributors

Install ty 0.0.1-alpha.20

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.20/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.20/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.20

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
[ty-...
Read more

0.0.1-alpha.19

19 Aug 13:30
e9cb838

Choose a tag to compare

0.0.1-alpha.19 Pre-release
Pre-release

Release Notes

Bug fixes

  • Fix false-positive diagnostics if a function parameter is annotated with type[P] where P is a protocol class (#19947)
  • Fix ANSI colors in terminal output on old Windows terminals (#19984)
  • Fix protocol interface inference for protocols in stub files with ClassVar members and "subprotocols" that extend other protocols (#19950)
  • Fix inference of equality comparisons between enum members (#19666)
  • Remove incorrect type narrowing for if type(x) is C[int] (#19926)
  • Improve detection of 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.
  • Fix incorrectly precise type inference in some situations involving nested scopes (#19908)
  • Fix unpacking a type alias with a precise tuple spec (#19981)

NamedTuple semantics improvements

  • Synthesize read-only properties for all declared members on NamedTuple classes (#19899)
  • Allow any instance of a NamedTuple class to be passed to a function parameter annotated with typing.NamedTuple (#19915)
  • Detect NamedTuple classes where fields without default values illegally follow fields with default values (#19945). This causes TypeError to be raised at runtime.
  • Detect illegal multiple inheritance with NamedTuple (#19943). This causes TypeError to be raised at runtime.

Other typing and semantics improvements

  • Add support for stubs packages with partial in their py.typed files (#19931)
  • Look for 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.
  • Add diagnostics for invalid await expressions (#19711)
  • Add else-branch narrowing for if type(a) is A when A is @final (#19925)
  • Improve solving of typevars with defaults, and typing.Self (#19786)
  • Support the kw_only parameter for dataclasses.dataclass() and dataclasses.field() (#19677)
  • Sync vendored typeshed stubs (#19923). Typeshed diff.

Server improvements

  • Improve goto/hover for definitions (#19976)

Performance improvements

  • Short-circuit a server inlay hints request if all settings under ty.inlayHints are disabled (#19963)
  • Speedup server tracing checks (#19965)
  • Add caching to logic for inferring whether a class is a NamedTuple, a dataclass or a TypedDict (#19912)
  • Speedup project file discovery (#19913)

Contributors

Install ty 0.0.1-alpha.19

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.19/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.19/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.19

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ty-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ty-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
ty-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
ty-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
ty-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
ty-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum

0.0.1-alpha.18

14 Aug 10:32
d697cc0

Choose a tag to compare

0.0.1-alpha.18 Pre-release
Pre-release

Release Notes

Bug fixes

Server

  • Implement support for "rename" language server feature (#19551)
  • Add ty.experimental.rename server setting (#19800)
  • Add ty.inlayHints.variableTypes server setting (#19780)
  • Add inlay hints for call arguments (configured by ty.inlayHints.callArgumentNames server setting) (#19269)
  • Enable goto definition to jump to the runtime definition in the standard library for stdlib symbols (rather than the type definition in typeshed's stubs) (#19529)
  • Support LSP client settings (#19614)
  • Update goto range for attribute access to only target the attribute (#19848)
  • Warn users if the server received unknown options (#19779)
  • Render docstrings in hover (#19882)
  • Resolve docstrings for modules (#19898)

Typing semantics and features

  • Add precise inference for indexing, slicing and unpacking NamedTuple instances (#19560)
  • Disallow typing.TypedDict in type expressions (#19777)
  • Implement module-level __getattr__ support (#19791)
  • Improve ability to solve TypeVars when they appear in unions (#19829)
  • Improve subscript narrowing for collections.ChainMap, collections.Counter, collections.deque and collections.OrderedDict (#19781)
  • Extend all tuple special casing to tuple subclasses (#19669)
  • Use separate Rust types for bound and unbound type variables (#19796)
  • Validate writes to TypedDict keys (#19782)
  • typing.Self is bound by the method, not the class (#19784)
  • Fix deferred name loading in PEP695 generic classes/functions (#19888)
  • Improve handling of symbol-lookup edge cases involving class scopes (#19795)

Performance

  • Improve performance around tuple types (#19840)
  • Improve performance of subtyping and assignability checks for protocols (#19824)
  • Improve multithreaded performance for large codebases (#19867)

Memory usage optimizations

  • Reduce memory usage of TupleSpec and TupleType (#19872)
  • Reduce size of member table (#19572)

Contributors

Install ty 0.0.1-alpha.18

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.18/ty-installer.sh | sh

Install prebuilt binaries via powershell script

powershell -ExecutionPolicy Bypass -c "irm https://github.com/astral-sh/ty/releases/download/0.0.1-alpha.18/ty-installer.ps1 | iex"

Download ty 0.0.1-alpha.18

File Platform Checksum
ty-aarch64-apple-darwin.tar.gz Apple Silicon macOS checksum
ty-x86_64-apple-darwin.tar.gz Intel macOS checksum
ty-aarch64-pc-windows-msvc.zip ARM64 Windows checksum
ty-i686-pc-windows-msvc.zip x86 Windows checksum
ty-x86_64-pc-windows-msvc.zip x64 Windows checksum
ty-aarch64-unknown-linux-gnu.tar.gz ARM64 Linux checksum
ty-i686-unknown-linux-gnu.tar.gz x86 Linux checksum
ty-powerpc64-unknown-linux-gnu.tar.gz PPC64 Linux checksum
ty-powerpc64le-unknown-linux-gnu.tar.gz PPC64LE Linux checksum
ty-s390x-unknown-linux-gnu.tar.gz S390x Linux checksum
ty-x86_64-unknown-linux-gnu.tar.gz x64 Linux checksum
ty-armv7-unknown-linux-gnueabihf.tar.gz ARMv7 Linux checksum
ty-aarch64-unknown-linux-musl.tar.gz ARM64 MUSL Linux checksum
ty-i686-unknown-linux-musl.tar.gz x86 MUSL Linux checksum
ty-x86_64-unknown-linux-musl.tar.gz x64 MUSL Linux checksum
ty-arm-unknown-linux-musleabihf.tar.gz ARMv6 MUSL Linux (Hardfloat) checksum
ty-armv7-unknown-linux-musleabihf.tar.gz ARMv7 MUSL Linux checksum