github astral-sh/ty 0.0.13

10 hours ago

Release Notes

Released on 2026-01-21.

Bug fixes

  • Fix --force-exclude when excluding entire directories (#22595)
  • Fix missing syntax highlighting for aliased import names (#22675)
  • Highlight interpolated-parts in t-strings (#22674)
  • Fix the inferred MRO of functional namedtuple classes (#22722)
  • Make special cases for subscript inference exhaustive, ensuring that the special casing for tuple subscripts is applied when a union of tuples or an alias to a tuple type is subscripted (#22035)

LSP server

  • Improve completion suggestions inside class definitions (#22571)
  • Improve performance of completions (#22630)
  • Remove completion suggestions for redundant re-exports that share the same top-most module (#22581)

Core type checking

  • Add basic support for overloads in ParamSpec (#21946)
  • Allow ... as a default value for any parameter if the function is in an if TYPE_CHECKING block (#22624)
  • Allow if type(x) is Y narrowing for types other than class-literal types (#22729)
  • Avoid overload errors when detecting dataclass-on-tuple (#22687)
  • Avoid reporting overload errors for successful union variants (#22688)
  • Ban NewTypes with generic bases (#22653)
  • Fix PEP 695 type aliases not expanding in overload resolution (#22589)
  • Fix the return type for synthesized NamedTuple.__new__ methods (#22625)
  • Emit diagnostics for NamedTuple, TypedDict, Enum or Protocol classes decorated with @dataclass (#22672)
  • Emit invalid-type-form diagnostics for stringified annotations where the quoted expression is invalid (#22752)
  • Infer the implicit type of cls in __new__ methods (#22584)
  • Make ModuleType and object attributes available on namespace packages (#22606)
  • Make NamedTuple(...) and namedtuple(...) calls stricter (#22601)
  • Narrow on bool and byte subscripts (#22684)
  • Narrow on negative subscript indexing (#22682)
  • Override __file__ to str when applicable on imported modules (#22333)
  • Add bidirectional inference for comprehensions (#22564)
  • Recognize string-literal types as subtypes of Sequence[Literal[chars]] (#22415)
  • Add right-hand-side narrowing for if Foo is type(x) expressions (#22608)
  • Add simple syntactic validation for the right-hand side of PEP-613 type aliases (#22652)
  • Add support for passing typename and field_names by keyword argument to collections.namedtuple() calls (#22660)
  • Add support for starred unpacking in class bases (#22591)
  • Validate constructor arguments when a class is used as a decorator (#22377)
  • Validate field names for typing.NamedTuple(...) (#22599)
  • Add diagnostic on overridden __setattr__ and __delattr__ in frozen dataclasses (#21430)
  • Fix unary operators on NewTypes of float or complex (#22605)

Configuration

  • Support overriding respect-type-ignore-comments (#22615)

Diagnostics

  • Don't add a subdiagnostic pointing to the TypeVar definition if the TypeVar is Self (#22646)
  • Show final search path instead of "and 1 more paths" (#22776)
  • Group type[] elements together when displaying union types (#22592)

Performance

  • Cache ClassType::nearest_disjoint_base (#22065)

Other changes

Contributors

Install ty 0.0.13

Install prebuilt binaries via shell script

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/ty/releases/download/0.0.13/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.13/ty-installer.ps1 | iex"

Download ty 0.0.13

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

Don't miss a new ty release

NewReleases is sending notifications on new releases.