Skip to content

Update dependency ty to v0.0.109 - #270

Merged
AlexWaygood merged 1 commit into
mainfrom
renovate/ty
Nov 24, 2026
Merged

AlexWaygood merged 1 commit into
mainfrom
renovate/ty

Conversation

@renovate

@renovate renovate Bot commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
ty (changelog) ==0.0.108 → ==0.0.109 age confidence

Release Notes

astral-sh/ty (ty)

v0.0.109

Compare Source

Released on 2026-11-23.

Bug fixes
  • Preserve type variables from the surrounding scope when inferring generic calls. For example, forwarding a list[T] through a generic helper can now preserve list[T] as the result type. (#​30423)
  • Use the receiver’s type to select overloads when a method is called through an alias. For example, an alias of a Redis method can now infer an awaitable return type for an asynchronous client. (#​29341)
  • Report unknown-argument when copy.replace or a generated __replace__ receives an init=False field. This applies to standard-library and Pydantic dataclasses, attrs classes, and other classes using dataclass_transform. (#​30850)
  • Preserve literals when union simplification discards the member that would have made them redundant. This also fixes a crash when checking some unions of recursive protocols. (#​30774)
  • Accept self as a field keyword in dataclass and Pydantic constructors and in dataclass and named tuple replacement methods. (#​29341)
  • Infer Self from the receiver and field arguments in generated dataclass and named tuple methods, so an inherited method can accept a base-class value for a field annotated with Self. (#​29341)
LSP server
  • Speed up member completions when looking up documentation for classes and enums with many attributes, such as Flet’s Icons and PySide6’s Qt.Key. (#​30707)
Diagnostic improvements
  • Rename the diagnostic for unknown rules in ignore comments to unknown-rule-in-ignore-comment. The old name, ignore-comment-unknown-rule, remains a compatibility alias in configuration and ignore comments. Run ty check --fix to update ignore comments automatically. (#​30827)
Performance improvements
Calls and overloads
  • Check nested calls such as NumPy’s dot(dot(a, b), c) faster when several outer overloads give the inner call the same expected return type. (#​30785)
  • Reuse successful inference for ordinary type variables and Self across generic calls with matching parameter and argument types, when there’s no expected return type or unpacked variadic parameter. (#​30815)
  • Speed up overload resolution by reusing comparisons of parameter and return types when several overloads match. (#​30781)
  • Check whether matching overloads cover all possible arguments faster when consecutive overloads infer the same argument types, as can happen with boto3 client calls. (#​30789)
  • Speed up repeated calls to overloads that share a type variable, such as TypedDict.get overloads that share the type of the default argument. (#​30813)
  • Check calls to ordinary functions faster when many arguments are captured by *args or **kwargs. (#​30734)
  • Speed up call inference by avoiding unnecessary copies of inferred argument types, including on the first pass of generic inference. (#​30826)
Generics and recursive types
  • Speed up type compatibility checks that must hold for every specialization of a type variable, including assignability and equivalence checks. (#​30748)
  • Solve generic type constraints faster by reusing results for pairs of constraints that yield no new information. (#​30788)
  • Speed up inference for recursive types whose generic arguments share nested unions. (#​30735)
  • Limit alias expansion and cycle checks to aliases and recursive types. (#​30828)
Classes and TypedDicts
  • Check assignments to instance attributes faster when repeated assignments give the attribute a wide union type, as in tokenizer state machines. (#​30775)
  • Speed up repeated comparisons between TypedDicts and unions, including recursive unions such as Pydantic’s CoreSchema. (#​30555)
  • Determine whether a class is abstract faster when its methods use decorators that preserve the method’s type. (#​30802)
  • Check enums with built-in tuple values faster when using the bundled standard-library stubs. (#​30777)
  • Check attribute assignments and deletions faster when the class and its bases are unfrozen. (#​30820)
  • Speed up checks for inherited dataclass ordering by looking up decorators only on base classes with ordering enabled. (#​30810)
Unions, narrowing, and literals
  • Speed up large match statements that rule out many literal values, such as integer opcode dispatch. (#​30736, #​30767)
  • Reuse the result of simplifying wide unions when narrowing types or merging assignments across branches. (#​30705)
  • Speed up narrowing when a name or attribute has a single possible type. With analysis.strict-generic-narrowing = true, this also lets an isinstance check narrow a value to a more specific type when a recursively inferred type argument was approximated as object. (#​30829)
  • Simplify unions of fixed-length tuples faster when their first elements have disjoint literal types. (#​30793)
  • Simplify unions faster when their members come from different unresolved inference cycles. (#​30791)
  • Speed up str.startswith checks on values with many possible literal strings, such as enum member names. (#​30811)
  • Reduce the cost of narrowing names, attributes, and subscripts, including when the relevant conditions are in the current scope. (#​30773, #​30816)
  • Simplify unions faster when they collapse to a single type. (#​30817)
Collections and iteration
  • Infer collection literals faster when several elements widen to the same type, such as a list of floats. Reuse the numeric unions ty infers for float and complex. (#​30796, #​30695)
  • Infer long tuple literals faster when many elements widen to the same built-in type. (#​30677)
  • Reuse the inferred element type when iterating over the same synchronous iterable type again. (#​30814)
File discovery, imports, and control flow
  • Speed up control flow analysis in large dispatch functions by reusing narrowing and reachability results along shared paths. (#​30787, #​30784)
  • Discover files faster with the default src.include pattern or when all exclude patterns apply only to directories. (#​30772, #​30794)
  • Check which code is reachable faster in large scopes, including those where wildcard imports bring many names into scope. (#​30771, #​30778)
  • Speed up control flow analysis when branches leave the same definitions in scope, including in deeply nested with blocks. (#​30803)
  • Resolve references to imported submodules faster after dotted imports such as import a.b.c. (#​30722)
Core type checking
  • Infer enum.auto() values from preceding members in both class-based and functional enums. For sequential integer values, ty counts from the last value through Python 3.10 and from the highest value for Python 3.11 and later targets. It can infer int when the exact value depends on runtime data or control flow. (#​30548)
  • Use the underscore-stripped name of an attrs field in constructors and copy.replace. For example, a field accessed as _id takes the keyword id by default. An explicit alias takes precedence. (#​30824)
  • Infer the specific exception type bound by except ... as exc when the handler uses a type alias for a tuple of exception classes or a union of an exception class and a tuple. (#​30758)
  • Recognize @field_name.validator on fields declared with attrs.field or attr.ib, fixing false missing-attribute errors and preserving the decorated method’s signature. (#​30839)
  • Fix false not-callable errors on attrs @field_name.default decorators for fields that ty treats as required constructor arguments. (#​30839)
  • Infer the enum type when conditional member declarations make an alias’s canonical member uncertain. (#​30548)
Contributors

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the internal label Nov 24, 2026
@AlexWaygood
AlexWaygood merged commit 3f21e49 into main Nov 24, 2026
3 checks passed
@AlexWaygood
AlexWaygood deleted the renovate/ty branch November 24, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant