pypi / ty
ty
What changed in ty 0.0, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
19 breaking3 security4 deprecations11 new APIs and options18 performance52 behavior and defaults26 tooling183 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initty 0.0316 changes
Breaking changes 19
Enables the invalid-mutable-override rule by default.
Type checking now checks attribute and property override types.
The default Python version is updated to 3.15.
Treats bound methods without a receiver as not callable.
Limits wildcard exports using a literal __all__.
Notebook files are no longer read when discovering scripts.
Rejects class-scoped type variables in __init__ receivers.
Rejects unsafe TypedDict updates from hidden fields.
Instantiating an abstract class is rejected.
Imports are treated as bindings instead of declarations.
Reassignment of enum members is now rejected.
Type checking reports override conflicts introduced by new bases.
Requires a direct dependency for reveal_type backport fixes.
Rejects missing attributes on type[] aliases.
Rejects circular type alias definitions.
Rejects class access to generic instance attributes.
Invalidates member narrowing across loop iterations.
Fixed tuples are rejected for non-inferable TypeVarTuples.
Incompatible constructor context is rejected for variadic packs.
Security 3
macOS and Windows executables in release archives and ty wheels are signed, enabling publisher and binary integrity verification and supporting publisher-based allowlisting.
Fixes a use-after-free vulnerability that could allow arbitrary code execution when analyzing a specially crafted Python project; users running ty on untrusted code should upgrade.
Embeds archive checksums in the shell installer.
Deprecations 4
Reports deprecated overloads in decorator applications.
Deprecation diagnostics are reported for property accessors on intersections.
Deprecation diagnostics are reported for implicit constructor calls.
Deprecation diagnostics are reported for overloads, operators, and properties.
New APIs and options 11
This setting enables return type inference; it is disabled by default.
Adds the mismatched-sentinel-name rule as an opt-in diagnostic.
Supports slots_default in dataclass_transform.
Adds the opt-in truthiness-test-of-none-union rule.
Introduces Recursive types and full support for recursive implicit type aliases.
Adds support for type[A & B].
Adds rules to detect conditions that are always truthy or always falsy.
A new diagnostic rule reports disjoint casts.
Adds a preview rule that detects missing direct dependencies.
A dedicated diagnostic is available for missing slots.
Tagged unions support multiple tags per type.
Performance 18
Speeds up generic class-pattern narrowing by skipping impossible intersection comparisons.
Avoids constructing nominal complements.
Optimizes system path equality.
Constraints are shared in retained sequent maps to improve memory usage.
Reuses cached type alias inference for diagnostics.
Fuel management in the constraint solver is optimized.
Strings in dependency metadata are shared to improve memory usage.
Rendered union elements are reused when displaying types.
Reduces retained AST memory by shrinking expressions.
Avoids redundant superclass member inference.
Distributes len inference over unions.
Adds a fast path for concrete literal intersections.
Avoids repeated subtyping checks for materialized recursive protocols.
Recursive protocol checks for nested type variables are optimized.
Repeated inference is avoided for literal union call results.
Rejects impossible eager protocol comparisons early.
Avoids cubic narrowing with repeated assignments and context managers.
Avoids repeated traversal of shared alias arguments.
Behavior and default changes 52
ty supports inferring return types for unannotated functions and methods.
A bare generic class name is specialized when used in a type[...] type context.
Inherited dataclass field converters are specialized.
Empty collection branches are inferred from nonempty literals.
Recursion guards are avoided for non-generic nominal targets.
Promotes bounded type variables to declared constraints.
Import completions in the LSP server now support namespace packages.
Infers nominal generic specializations from bounded type variables.
Ruff and ty now prefer existing @ paths over response files when resolving command-line arguments.
The LSP server refreshes Python settings when virtual environments change.
Rendered code is contained within Markdown fences in LSP output.
Specializes Self bounds through generic type aliases.
Inherits annotations for unannotated subclass defaults.
Refreshes uv project metadata when uv files change, so ty can use up-to-date project information.
Callable signatures are now inferred from bounded type variables.
Membership expressions with constant values in inline list and set literals can now be inferred as literal booleans.
Uses subtyping when determining constraint-set implication.
External files use workspace editor settings.
Projects for external files are selected using import search paths.
This diagnostic is disabled by default.
The LSP server now supports requests against closed documents.
Inference now works through optional generic containers in the legacy solver.
Includes required imports in every inlay hint.
Eagerly binds unused Self receivers.
Allows slots to override abstract properties.
Generalizes receiver binding for wrapped callables.
Conditional literals are inferred from peers in unspecialized contexts.
Dependency lints are supported when using this CLI option.
Generic elements are inferred from gradual tuples.
Experimental intersection syntax is allowed in PEP 695 aliases.
LSP string literal completions are filtered by the text already typed.
Preview behavior ignores the Python version from uv metadata.
Default exclude patterns are anchored at the project root.
Class objects are default-specialized during meta-protocol checks.
Existing autofixes receive descriptive titles in the LSP server.
Tuple variance is inferred from the full tuple specification and more precisely.
Narrows types with ordered length comparisons.
Infers variance through recursive protocols.
Lambda functions are always considered truthy.
In preview, workspace metadata is refreshed when dependencies change.
Recursive receiver inference is stabilized.
Simplifies intersections with subtype-related generic specializations.
Infers lambda parameters through callable type aliases.
Superseded queued uv requests are now canceled.
Treats recursive types as fallback cycles only when they have unbounded specializations.
Warns when uv metadata cannot support dependency checks.
Refreshes uv project metadata in the background.
Signatures inferred from bound receivers are expanded.
Tuple type parameters are inferred from union arguments.
Mixed gradual tuple assignability is supported with TypeVarTuple.
On Python 3.14 and newer, typing.Union is treated as a class.
Variance is inferred through nonrecursive protocol references.
Tooling 26
Reports assignments to individually frozen Pydantic fields.
Improves the display of distinct string literal types.
The LSP server shows documentation for annotation operators on hover.
The LSP server completes string keys from dictionary initializers.
Improves diagnostics for async generator stubs.
Improves primary diagnostic annotations for redundant-condition and redundant-condition-strict diagnostics.
Adds rules detecting suspicious uses of Callable, Iterable, Iterator, or Generator types in a boolean context.
Expands unreachable-code annotations for redundant conditions.
Preview CLI watch mode watches script dependencies.
The language server watches script dependencies.
LSP can find member references across files.
LSP can find parameter references across files.
Rules add subdiagnostics warning about reachability implications.
Diagnostics for unimplemented abstract members are clarified.
Diagnostics annotate unreachable code caused by boolean operands, and annotations extend to while, assert, and match statements.
An autofix is added for unused awaitables.
Suggests variable-length tuple annotations for redundant conditions.
Adds Find references support for pytest fixtures.
Checks direct dependencies in PEP 723 scripts.
Synchronizes PEP 723 script environments in the language server.
Highlights PEP 723 script metadata as TOML in the LSP server.
Moves script environment initialization to the CLI and LSP.
More diagnostics have autofixes available.
The CLI can initialize environments for PEP 723 scripts.
The LSP server supports Go to Definition for pytest fixtures.
The type checker resolves fixtures through conftest.
Fixes and other changes 183
Avoids a panic when negating dynamic type aliases.
Reports invalid Generic and Protocol arguments containing nested variadic type variables.
Tuple literal lengths are widened when other collection elements contain nested tuple types.
Fixes checks through bounded or constrained type variables.
Preserves inherited annotations for unannotated subclass attributes when a base has type Any or Unknown.
Detects conflicts hidden by additional base classes.
Improves type inference for intersection arguments to generic functions.
Fixes false errors when overriding object attributes.
Preserves known module owners when uv reports owners outside the resolution.
Preserves common return-type structure when gradual arguments match multiple overloads.
Fixes false missing-argument errors when Pydantic models override inherited attributes with ClassVar.
Avoids panics and hangs involving recursive type aliases and intersections.
Checks upper bounds when inferring type variables from caller type variables.
Identical argument type diagnostics are deduplicated.
Suppression of attribute override diagnostics is respected.
Notebook cell lookups work correctly after cells with cell magics.
Notebook cell positions are clamped to the end of the cell.
Fixes a panic when requesting completions past the end of a notebook's last cell.
Type checking now checks overrides of receiver attribute declarations.
Infers the default for definitely absent keys in closed TypedDict.get calls.
Preserves minimum lengths when unpacking tuple unions.
Unpacking a variable-length argument leaves room for later positional arguments.
Fixes a deadlock when LSP requests arrive before workspace configuration.
Recursive structure in
Annotatedvalues is preserved.The CLI always shows fixes.
Dependency metadata is invalidated when environments change.
Literal types are preserved when dictionary literals are consumed.
Exact exclusions are checked before intersection positives.
Final attribute restrictions are preserved on composite types.
Non-boolean comparison results are preserved for intersections.
Tuple unions are narrowed through truthiness and type checks.
Unicode support is updated to Unicode 17.
Uninhabited truthiness is represented explicitly.
Receiver specializations are preserved when calling unions of bound methods.
Validity type context is solved through constraint sets.
Preserves constrained type-variable failure diagnostics.
The LSP server avoids stale I/O diagnostics when a deleted file is closed.
Avoids reporting disjoint-cast diagnostics when the value could have been inferred as compatible with the cast type using the right type context.
Fixes a stack overflow when inferring dynamic class metaclasses.
Fixes type variable inference for final class objects.
Passes generic context to the call inference solver.
Preserves generic inference errors during diagnostic recovery.
Honors generic property setters when checking protocol compatibility.
Fixes include and exclude pattern anchoring after the project root changes.
Narrows later match cases after guards that are always true.
Bounds how nested callable signatures are displayed in diagnostics.
Validates union operands involving None.
Compares observable notebook state for equality.
Detects recursive alias cycles through intersections.
Avoids panics involving recursive lambda class decorators.
Improves display of string literal types containing Unicode characters or double quotes.
Preserves tuple shapes when slicing NewTypes.
Preserves tuple subclass identity during type expansion.
Recognizes bare TypeVarTuples in materialization checks.
Fixes member lookup on union-bounded type variables.
Metadata errors explain when the uv version is outdated, and uv metadata diagnostics are improved.
Preserves call narrowing during cyclic inference.
Fixes disjointness checking for generic class types.
Only reachable definitions are considered when deciding whether conditions defined relative to version, platform, OS, or type-checking state should be exempted.
Fixes stale LSP diagnostics after toggling this setting.
Fixes staticmethod shadowing through generic receivers and unions.
Preserves intersections of type guard return types.
Avoids incorrect simplification of TypeIs materializations.
Preserves inferred bindings during annotation cycles.
Represents bound methods more faithfully.
Respects fixed caller type variables when selecting constraints.
Classifies evidence bounds only for constrained type variables.
Points each misplaced tuple ellipsis diagnostic at the corresponding ellipsis.
Preserves fast name filtering for normalized Unicode source.
Preserves PEP 695 bindings across nested classes.
Preserves quoted aliases during cycle recovery.
Fixes hangs caused by repeated partial application.
Avoids leaking Unknown from unconstrained collection use-sites.
Diagnoses unguarded cycles in implicit and PEP 613 aliases.
Simplifies unions of disjoint exclusions.
Refreshes diagnostics after workspace configuration changes.
Declared variance is checked against final method bindings.
Field metadata is preserved after overload resolution.
Overrides of frozen=False on Pydantic subclasses are respected.
The disjointness of functools.partial types is improved.
Valid LSP settings are preserved when configuration resolution fails.
Recursive protocol checks work for decorated methods.
Gradual tuple lengths are preserved during callable inference.
Tuple shapes are preserved during concatenation.
The CLI skips uv workspace metadata only for a single script.
Fixes assignability of bounded typevars to intersection types.
Dependencies are resolved within correlated inference alternatives.
Descriptor detection now ignores divergent markers.
Type checking avoids rebinding extracted method calls.
Fixes MRO ordering for generic bases.
Glob characters in anchored directory paths are now escaped, preventing them from being interpreted as pattern syntax.
Type checking now handles gradual metaclass ancestry and conflicts.
Nominal descriptor checks preserve wrapped signatures.
Explicitly overridden constructor signatures are validated.
Union transformations preserve recursive metadata.
Type checking respects instance dictionary storage for slotted classes.
Narrowing tagged unions preserves runtime comparison semantics.
Fixes reduction of variadic partial signatures.
Fixes cached classmethods on generic classes.
Preserves callable identity across specialized types.
Fixes exclusion of directories when an ancestor is excluded.
Preserves wrapped functions in precise functools.partial relations.
Prevents the LSP server from hanging during bursts of inlay hints.
Preserves metaclass candidates after conflicts.
Unwraps union alternatives in overload implementations.
Preserves callback type context through ParamSpec forwarding.
Preserves redundant-condition diagnostics when operands are unreachable.
Respects the descriptor protocol for __set__ itself.
Fixes disjointness between type guards and boolean literals.
Respects type-variable bounds in argument context.
Checks captured receivers when calling wrapped classmethods.
Adds assert_never fixes for redundant final elif branches.
Adds await fixes for diagnostics about redundant conditions.
Preserves deprecations on decorated callables.
Avoids panics when typing is shadowed in dict keyword calls.
Solves formal unions using constraint-sets.
Preserves gradual type context during generic call inference.
Ensures f is identity(f) evaluates to Literal[True].
Recovers cycles when constructing known class instances.
Discovers configs in models derived from legacy generic classes.
Adds Literal fixes for diagnostics that flag invalid type annotations.
Promotes literals in nested, non-covariant positions.
Fixes callable specialization with union-valued ParamSpec.
Preserves outer type variables during ParamSpec inference.
Preserves protocol intersections when narrowing gradual types.
Declares support for Python 3.15.
Normalizes recursive collection-use constraints.
Preserves nominal subtyping for top-materialized protocols.
Avoids falling back to Unknown when collecting type context constraints.
Aligns TypeIs narrowing with isinstance narrowing.
Captured bound-method receivers are treated covariantly.
Cyclic intersection simplification is deterministic.
Terminal-call reachability in cyclic cases is stabilized.
Diagnostics are deferred to avoid recursive-default cycles.
Deprecation diagnostics respect overload selection.
Generic protocol materialization relations are preserved.
Unsound intersection simplification for generic iterables is fixed.
Type variables are respected in top/bottom materializations.
Negative narrowing is fixed for protocols with gradual members.
Bindings inferred against type context are preserved.
Uncertain branches are preserved during quantification.
Type variable scopes are validated in constructors and aliases.
Condition truthiness is stabilized during cyclic inference.
Recursive protocol traversal in generic intersections is now bounded.
Generic receivers are preserved in implicit __init_subclass__ calls.
Deletions are propagated through nested loop headers.
Recursion guards are preserved across nested type operations.
Removing redundant casts now preserves syntax and comments.
Specialization is preserved for inherited TypedDict methods.
Fixes a panic in auto-completion involving bare declarations.
Preserves type variables in bounded generic defaults.
Preserves inferred types for unknown class-decorator results.
Validates declared variance in method signatures.
Preserves Final variance in stubs.
Narrows functional enum members in equality comparisons and match statements.
Fixes Goto definition behavior in script dependencies.
Uses the subclass receiver when checking method overrides.
Applies mixin specialization when validating enum members.
Avoids panics on incomplete protocol type parameter lists.
Guards recursive meta-type expansion.
Preserves parentheses when removing redundant casts.
Synchronizes saved script metadata on open.
Binds Self through generic type aliases.
Preserves short-circuit reachability for direct conditions.
Preserves list literal positions in starred unpacking.
Narrowing through branch-assigned conditions is made sound.
collections.abc.Callable is recognized as an instance of type.
Equality inference accounts for known subclasses.
Correlated generic-call inference is preserved.
Generic protocol variance is validated.
Invariant materialization constraints are preserved.
Bounds of non-literal metaclasses are preserved.
Inconsistent binding decorators on overloads are ignored.
PEP 723 script environments are refreshed in watch mode.
The type checker resolves imported pytest fixture exposures.
The type checker resolves fixture providers installed by core pytest.
Bounds of Self are specialized for inherited methods.
Self binding in ParamSpec protocols is corrected.
Diagnostics explain missing storage for declared slotted attributes.
Variance inference for TypedDict is corrected.
Bare TypeVarTuples are recovered in tuple annotations.
Diagnostic spans are improved for unpacked variable assignments.
Send and return types are inferred from the iterator returned by __iter__.