github astral-sh/ty 0.0.1-alpha.21

pre-release19 hours ago

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