Skip to content

Conversation

@ibraheemdev
Copy link
Member

Summary

Resolves astral-sh/ty#1712.

@ibraheemdev ibraheemdev added the ty Multi-file analysis & type inference label Dec 2, 2025
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 2, 2025

Diagnostic diff on typing conformance tests

No changes detected when running ty on typing conformance tests ✅

@ibraheemdev ibraheemdev force-pushed the ibraheem/type-of-subtyping branch from 6f9841d to 84af3c9 Compare December 2, 2025 20:59
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 2, 2025

mypy_primer results

Changes were detected when running on open source projects
prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/flow_runs.py:291:19: error[unresolved-attribute] Object of type `(type[T@_in_process_pause] & ~AlwaysTruthy & ~AlwaysFalsy) | (type[T@_in_process_pause] & ~AlwaysFalsy)` has no attribute `load`
+ src/prefect/flow_runs.py:291:19: error[unresolved-attribute] Object of type `type[T@_in_process_pause] & ~AlwaysFalsy` has no attribute `load`
- src/prefect/flow_runs.py:306:15: error[unresolved-attribute] Object of type `(type[T@_in_process_pause] & ~AlwaysTruthy & ~AlwaysFalsy) | (type[T@_in_process_pause] & ~AlwaysFalsy)` has no attribute `save`
+ src/prefect/flow_runs.py:306:15: error[unresolved-attribute] Object of type `type[T@_in_process_pause] & ~AlwaysFalsy` has no attribute `save`
- src/prefect/flow_runs.py:318:34: error[unresolved-attribute] Object of type `(type[T@_in_process_pause] & ~AlwaysTruthy & ~AlwaysFalsy) | (type[T@_in_process_pause] & ~AlwaysFalsy)` has no attribute `load`
+ src/prefect/flow_runs.py:318:34: error[unresolved-attribute] Object of type `type[T@_in_process_pause] & ~AlwaysFalsy` has no attribute `load`
- src/prefect/flow_runs.py:445:26: error[unresolved-attribute] Object of type `(type[T@suspend_flow_run] & ~AlwaysTruthy & ~AlwaysFalsy) | (type[T@suspend_flow_run] & ~AlwaysFalsy)` has no attribute `load`
+ src/prefect/flow_runs.py:445:26: error[unresolved-attribute] Object of type `type[T@suspend_flow_run] & ~AlwaysFalsy` has no attribute `load`
- src/prefect/flow_runs.py:455:15: error[unresolved-attribute] Object of type `(type[T@suspend_flow_run] & ~AlwaysTruthy & ~AlwaysFalsy) | (type[T@suspend_flow_run] & ~AlwaysFalsy)` has no attribute `save`
+ src/prefect/flow_runs.py:455:15: error[unresolved-attribute] Object of type `type[T@suspend_flow_run] & ~AlwaysFalsy` has no attribute `save`
- src/prefect/server/services/base.py:102:21: error[invalid-argument-type] Argument to bound method `append` is incorrect: Argument type `list[type[Self@all_services]]` does not satisfy upper bound `list[_T@list]` of type variable `Self`
- src/prefect/utilities/collections.py:206:17: error[no-matching-overload] No overload of bound method `setdefault` matches arguments
- src/prefect/utilities/collections.py:210:16: error[invalid-argument-type] Method `__getitem__` of type `bound method dict[type[T@extract_instances], list[Any]].__getitem__(key: type[T@extract_instances], /) -> list[Any]` cannot be called with key of type `Unknown` on object of type `dict[type[T@extract_instances], list[Any]]`
- Found 3399 diagnostics
+ Found 3396 diagnostics

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/_logging.py:153:13: warning[unsupported-base] Unsupported class base with type `<class 'Mapping[str, Style]'> | <class 'Mapping[str, Divergent]'>`
- Found 42 diagnostics
+ Found 41 diagnostics

ibis (https://github.com/ibis-project/ibis)
- ibis/util.py:708:24: error[not-iterable] Object of type `list[type[T@get_subclasses]]` is not iterable
- Found 4487 diagnostics
+ Found 4486 diagnostics

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- pandas-stubs/_typing.pyi:1207:16: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- Found 5815 diagnostics
+ Found 5814 diagnostics

materialize (https://github.com/MaterializeInc/materialize)
- misc/python/materialize/util.py:46:12: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `set[_T@set]`, found `set[type[T@all_subclasses]]`
- misc/python/materialize/util.py:46:45: error[not-iterable] Object of type `list[type[T@all_subclasses]]` is not iterable
- misc/python/materialize/zippy/framework.py:75:50: error[unsupported-operator] Operator `not in` is not supported between objects of type `type[Capability]` and `set[type[T@_remove]]`
- Found 3380 diagnostics
+ Found 3377 diagnostics

Memory usage changes were detected when running on open source projects
sphinx (https://github.com/sphinx-doc/sphinx)
-     memo metadata = ~76MB
+     memo metadata = ~80MB

@ibraheemdev ibraheemdev merged commit 7b0aab1 into main Dec 2, 2025
41 checks passed
@ibraheemdev ibraheemdev deleted the ibraheem/type-of-subtyping branch December 2, 2025 23:25
dcreager added a commit that referenced this pull request Dec 3, 2025
* origin/main:
  new module for parsing ranged suppressions (#21441)
  [ty] `type[T]` is assignable to an inferable typevar (#21766)
  Fix syntax error false positives for `await` outside functions (#21763)
  [ty] Improve diagnostics for unsupported comparison operations (#21737)
dcreager added a commit that referenced this pull request Dec 3, 2025
* origin/main:
  [ty] Improve `@override`, `@final` and Liskov checks in cases where there are multiple reachable definitions (#21767)
  [ty] Extend `invalid-explicit-override` to also cover properties decorated with `@override` that do not override anything (#21756)
  [ty] Enable LRU collection for parsed module (#21749)
  [ty] Support typevar-specialized dynamic types in generic type aliases (#21730)
  Add token based `parenthesized_ranges` implementation (#21738)
  [ty] Default-specialization of generic type aliases (#21765)
  [ty] Suppress false positives when `dataclasses.dataclass(...)(cls)` is called imperatively (#21729)
  [syntax-error] Default type parameter followed by non-default type parameter (#21657)
  new module for parsing ranged suppressions (#21441)
  [ty] `type[T]` is assignable to an inferable typevar (#21766)
  Fix syntax error false positives for `await` outside functions (#21763)
  [ty] Improve diagnostics for unsupported comparison operations (#21737)
  Move `Token`, `TokenKind` and `Tokens` to `ruff-python-ast` (#21760)
  [ty] Don't confuse multiple occurrences of `typing.Self` when binding bound methods (#21754)
  Use our org-wide Renovate preset (#21759)
  Delete `my-script.py` (#21751)
  [ty] Move `all_members`, and related types/routines, out of `ide_support.rs` (#21695)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invalid-argument-type with type[] generic inside union

3 participants