github astral-sh/ty 0.0.12

6 hours ago

Release Notes

Released on 2026-01-14.

Bug fixes

  • Avoid panic that could occur when casting an object to a TypedDict or union of TypedDicts (#22509)
  • Fix incorrect narrowing for if type(x) == y (#22531)
  • Fix stack overflow with recursive type aliases containing tuple types (#22543)
  • functools.total_ordering: ensure the signatures of generated methods reflect the signature of the user-provided method (#22496)
  • Support dataclass_transform as a function call (#22378)
  • Use the top materialization of classes for 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)
  • Avoid emitting Liskov violations with respect to a grandparent class if such violations could not be fixed without introducing Liskov violations with respect to a parent class (#22484)
  • Fix interaction between classmethod, contextmanager, and Self (#22407)
  • Check contravariant type variable bounds contravariantly in specialization inference (#22488)
  • Fix false positive for bounded type parameters with NewType (#22542)

Type checking

  • Add support for dynamic type() classes (#22291, #22499, #22537, #22480)
  • Add support for functional namedtuple creation (#22327, #22573, #22575, #22574)
  • Add a diagnostic for non-decorator uses of final (#22555)
  • Add diagnostic to catch generic enums (#22482)
  • Add diagnostics for __init_subclass__ argument mismatch (#22185)
  • Add diagnostics to validate TypeIs and TypeGuard definitions (#22300)
  • Apply type narrowing to walrus targets (#22369)
  • Detect invalid @total_ordering applications in non-decorator contexts (#22486)
  • Fix @Todo type for starred expressions (#22503)
  • Improve disambiguation of types in diagnostics (#22547)
  • Include type parameters in the display for generic Callable types (#22435)
  • Infer type[Unknown] for calls to type() when overload evaluation is ambiguous (#22569)
  • Support assignment to unions of TypedDicts (#22294)
  • Use the key and value parameter types as type context for __setitem__ dunder calls (#22148)
  • Narrow the right-hand side of ==, !=, is and is not conditions when the left-hand side is not narrowable (#22511)

LSP server

  • Fix __file__ type in completions to show str instead of str | None when the inferred type is str (#22510)
  • Improve rendering of ReST directives in docstrings (#22512)

Contributors

Install ty 0.0.12

Install prebuilt binaries via shell script

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

Download ty 0.0.12

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.