Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ty] Use constraint sets as pending state in SpecializationBuilder#24540

Merged
dcreager merged 38 commits into
mainfrom
dcreager/spec-builder-constraint-set
May 26, 2026
Merged

[ty] Use constraint sets as pending state in SpecializationBuilder#24540
dcreager merged 38 commits into
mainfrom
dcreager/spec-builder-constraint-set

Conversation

@dcreager

@dcreager dcreager commented Apr 10, 2026

Copy link
Copy Markdown
Member

This PR implements the bulk of the logic needed for astral-sh/ty#2799, by building up a ConstraintSet in SpecializationBuilder. This constraint set holds the "pending state" of the specialization being inferred. It will eventually replace the types hash map, which stores a simple mapping from typevars to inferred types, and which is always updated by unioning together types when we find multiple solutions for a typevar.

For now, we are building up both pending state representations, and solving from the constraint set where we can. There are two main cases where we must fall back on the old solver:

  • Any specialization that involves a ParamSpec
  • If the constraint set returns Unsatisfiable or Unconstrained

Follow-on PRs will address these remaining cases that use the old solver; once they are all migrated over to the constraint set solver, we will remove the types field.

Closes astral-sh/ty#2572
Closes astral-sh/ty#2959
Closes astral-sh/ty#3037
Closes astral-sh/ty#3203
Closes astral-sh/ty#3228
Closes astral-sh/ty#3428
Closes astral-sh/ty#3483

@astral-sh-bot

astral-sh-bot Bot commented Apr 10, 2026

Copy link
Copy Markdown

Typing conformance results improved 🎉

The percentage of diagnostics emitted that were expected errors increased from 89.52% to 89.70%. The percentage of expected errors that received a diagnostic held steady at 86.99%. The number of fully passing files improved from 90/134 to 91/134.

Summary

How are test cases classified?

Each test case represents one expected error annotation or a group of annotations sharing a tag. Counts are per test case, not per diagnostic — multiple diagnostics on the same line count as one. Required annotations (E) are true positives when ty flags the expected location and false negatives when it does not. Optional annotations (E?) are true positives when flagged but true negatives (not false negatives) when not. Tagged annotations (E[tag]) require ty to flag exactly one of the tagged lines; tagged multi-annotations (E[tag+]) allow any number up to the tag count. Flagging unexpected locations counts as a false positive.

Metric Old New Diff Outcome
True Positives 923 923 +0
False Positives 108 106 -2 ⏬ (✅)
False Negatives 138 138 +0
Total Diagnostics 1081 1078 -3
Precision 89.52% 89.70% +0.17% ⏫ (✅)
Recall 86.99% 86.99% +0.00%
Passing Files 90/134 91/134 +1 ⏫ (✅)

Test file breakdown

1 file altered
File True Positives False Positives False Negatives Status
dataclasses_transform_converter.py 9 0 (-2) ✅ 0 ✅ Newly Passing 🎉
Total (all files) 923 106 (-2) ✅ 138 91/134

False positives removed (2)

2 diagnostics
Test case Diff

dataclasses_transform_converter.py:104

-error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]`
-error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found `<class 'dict'>`

dataclasses_transform_converter.py:121

-error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`

@astral-sh-bot

astral-sh-bot Bot commented Apr 10, 2026

Copy link
Copy Markdown

Memory usage report

Summary

Project Old New Diff Outcome
prefect 695.44MB 720.36MB +3.58% (24.92MB)
sphinx 259.39MB 267.86MB +3.27% (8.48MB)
trio 111.64MB 113.90MB +2.02% (2.26MB)
flake8 46.12MB 46.86MB +1.60% (755.62kB)

Significant changes

Click to expand detailed breakdown

prefect

Name Old New Diff Outcome
infer_expression_types_impl 54.20MB 60.08MB +10.84% (5.88MB)
infer_definition_types 83.52MB 89.35MB +6.98% (5.83MB)
when_constraint_set_assignable_to_owned_impl 1.76MB 6.00MB +240.56% (4.23MB)
infer_scope_types_impl 48.48MB 50.56MB +4.29% (2.08MB)
when_constraint_set_assignable_to_owned_impl::interned_arguments 216.99kB 1.51MB +614.65% (1.30MB)
UnionType<'db>::from_two_elements_ 235.20kB 785.97kB +234.18% (550.78kB)
UnionType<'db>::from_two_elements_::interned_arguments 215.27kB 688.19kB +219.68% (472.91kB)
infer_expression_type_impl 7.76MB 8.19MB +5.52% (439.14kB)
UnionType 933.64kB 1.31MB +44.04% (411.20kB)
infer_statement_types_impl 775.68kB 1.08MB +42.41% (328.95kB)
infer_unpack_types 923.54kB 1.20MB +33.24% (306.98kB)
function_known_decorators 4.00MB 4.28MB +6.93% (283.80kB)
all_negative_narrowing_constraints_for_expression 6.31MB 6.58MB +4.25% (274.57kB)
all_narrowing_constraints_for_expression 6.52MB 6.74MB +3.39% (226.27kB)
CallableType 2.57MB 2.78MB +8.10% (213.11kB)
... 59 more

sphinx

Name Old New Diff Outcome
infer_expression_types_impl 19.63MB 21.94MB +11.75% (2.31MB)
when_constraint_set_assignable_to_owned_impl 1.07MB 2.90MB +171.86% (1.84MB)
infer_definition_types 22.70MB 23.94MB +5.46% (1.24MB)
when_constraint_set_assignable_to_owned_impl::interned_arguments 121.60kB 715.00kB +487.99% (593.40kB)
infer_scope_types_impl 12.99MB 13.46MB +3.56% (473.12kB)
UnionType<'db>::from_two_elements_ 130.79kB 327.92kB +150.73% (197.13kB)
all_negative_narrowing_constraints_for_expression 2.36MB 2.54MB +7.74% (187.25kB)
UnionType<'db>::from_two_elements_::interned_arguments 139.56kB 320.80kB +129.86% (181.24kB)
infer_expression_type_impl 2.87MB 3.01MB +5.03% (147.51kB)
UnionType 504.64kB 647.42kB +28.29% (142.78kB)
infer_statement_types_impl 425.71kB 565.07kB +32.74% (139.36kB)
all_narrowing_constraints_for_expression 2.47MB 2.60MB +5.10% (128.98kB)
infer_unpack_types 406.46kB 516.83kB +27.15% (110.37kB)
IntersectionType<'db>::from_two_elements_::interned_arguments 33.34kB 131.48kB +294.33% (98.14kB)
function_known_decorators 993.29kB 1.05MB +8.20% (81.48kB)
... 62 more

trio

Name Old New Diff Outcome
when_constraint_set_assignable_to_owned_impl 189.29kB 787.43kB +315.99% (598.14kB)
infer_expression_types_impl 6.20MB 6.74MB +8.68% (551.53kB)
infer_definition_types 7.43MB 7.69MB +3.46% (262.91kB)
when_constraint_set_assignable_to_owned_impl::interned_arguments 23.98kB 183.39kB +664.87% (159.41kB)
infer_scope_types_impl 4.01MB 4.13MB +2.91% (119.75kB)
infer_expression_type_impl 1.26MB 1.36MB +7.98% (103.05kB)
CallableType 647.69kB 692.66kB +6.94% (44.97kB)
infer_unpack_types 133.72kB 173.45kB +29.71% (39.73kB)
all_negative_narrowing_constraints_for_expression 560.45kB 591.76kB +5.59% (31.31kB)
all_narrowing_constraints_for_expression 588.96kB 612.66kB +4.02% (23.70kB)
UnionType<'db>::from_two_elements_::interned_arguments 30.77kB 53.62kB +74.30% (22.86kB)
FunctionType 1.54MB 1.56MB +1.43% (22.41kB)
UnionType<'db>::from_two_elements_ 28.47kB 50.41kB +77.06% (21.94kB)
cached_protocol_interface 123.75kB 142.54kB +15.18% (18.79kB)
assignable_solutions_impl 66.85kB 85.04kB +27.21% (18.19kB)
... 54 more

flake8

Name Old New Diff Outcome
when_constraint_set_assignable_to_owned_impl 92.24kB 314.95kB +241.44% (222.71kB)
infer_expression_types_impl 995.99kB 1.09MB +12.04% (119.95kB)
infer_definition_types 1.77MB 1.84MB +3.96% (71.84kB)
when_constraint_set_assignable_to_owned_impl::interned_arguments 10.91kB 79.49kB +628.35% (68.58kB)
infer_scope_types_impl 823.95kB 870.38kB +5.63% (46.43kB)
UnionType<'db>::from_two_elements_ 10.09kB 33.97kB +236.83% (23.89kB)
UnionType<'db>::from_two_elements_::interned_arguments 10.91kB 33.00kB +202.36% (22.09kB)
infer_statement_types_impl 36.02kB 51.02kB +41.64% (15.00kB)
CallableType 191.77kB 206.03kB +7.44% (14.27kB)
UnionType 54.92kB 68.27kB +24.30% (13.34kB)
StaticClassLiteral<'db>::variance_of_ 3.28kB 13.62kB +315.00% (10.34kB)
IntersectionType<'db>::from_two_elements_::interned_arguments 3.87kB 13.66kB +253.33% (9.80kB)
assignable_solutions_impl 25.56kB 35.28kB +38.03% (9.72kB)
StaticClassLiteral<'db>::variance_of_::interned_arguments 2.81kB 11.67kB +315.00% (8.86kB)
function_known_decorators 147.27kB 155.84kB +5.82% (8.58kB)
... 44 more

@astral-sh-bot

astral-sh-bot Bot commented Apr 10, 2026

Copy link
Copy Markdown

ecosystem-analyzer results

Lint rule Added Removed Changed
unsupported-operator 209 174 119
type-assertion-failure 112 143 102
invalid-argument-type 23 105 102
not-subscriptable 0 154 0
unresolved-attribute 23 82 39
no-matching-overload 1 126 0
invalid-return-type 4 29 5
invalid-assignment 14 5 12
not-iterable 1 16 0
unused-type-ignore-comment 1 3 0
assert-type-unspellable-subtype 0 0 1
invalid-raise 0 0 1
Total 388 837 381

Large timing changes:

Project Old Time New Time Change
pydantic 0.50s 2.80s +458%
hydra-zen 0.16s 0.70s +327%
apprise 0.33s 0.90s +170%
mongo-python-driver 0.23s 0.59s +160%
mitmproxy 0.39s 0.84s +114%
pip 0.36s 0.70s +95%
altair 0.33s 0.58s +74%
egglog-python 0.31s 0.50s +63%

Showing a random sample of 288 of 1606 changes. See the HTML report for the full diff.

Raw diff sample (288 of 1606 changes)
Expression (https://github.com/cognitedata/Expression)
- expression/collections/maptree.py:113:25 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:113:25 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`
- expression/collections/maptree.py:116:25 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Never, object]]`
+ expression/collections/maptree.py:116:28 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Never, Never]]`
- expression/collections/maptree.py:141:61 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`
+ expression/collections/maptree.py:141:61 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, object]]`, found `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`
- expression/collections/maptree.py:141:64 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
+ expression/collections/maptree.py:141:64 error[invalid-argument-type] Argument to function `mk` is incorrect: Expected `Option[MapTreeLeaf[Key@rebalance, Value@rebalance | Key@rebalance]]`, found `Option[MapTreeLeaf[Never, Never]]`
- tests/test_result.py:513:24 error[invalid-argument-type] Argument to bound method `PipeMixin.pipe` is incorrect: Expected `(Result[Literal[42], Any] | _A'return@curry_flip, /) -> _A'return@curry_flip | Result[Literal[42], Any]`, found `(_A'return@curry_flip, /) -> _A'return@curry_flip`
+ tests/test_result.py:513:24 error[invalid-argument-type] Argument to bound method `PipeMixin.pipe` is incorrect: Expected `(Result[Literal[42], Any], /) -> Result[Literal[42], Any] | _A'return@curry_flip`, found `(_A'return@curry_flip, /) -> _A'return@curry_flip`
- tests/test_seq.py:248:19 error[invalid-argument-type] Argument to function `pipe` is incorrect: Expected `(Iterable[int] | _A'return@curry_flip, /) -> _A'return@curry_flip | Iterable[int]`, found `(_A'return@curry_flip, /) -> _A'return@curry_flip`
+ tests/test_seq.py:248:19 error[invalid-argument-type] Argument to function `pipe` is incorrect: Expected `(Iterable[int], /) -> Iterable[int] | _A'return@curry_flip`, found `(_A'return@curry_flip, /) -> _A'return@curry_flip`

beartype (https://github.com/beartype/beartype)
- beartype/_util/func/arg/utilfuncargtest.py:302:12 error[invalid-return-type] Return type does not match returned value: expected `bool`, found `int`
- beartype/_util/func/arg/utilfuncargtest.py:331:12 error[invalid-return-type] Return type does not match returned value: expected `bool`, found `int`

boostedblob (https://github.com/hauntsaninja/boostedblob)
- boostedblob/boost.py:544:61 error[invalid-argument-type] Argument to function `create_task` is incorrect: Expected `Generator[Any, None, Unknown] | Coroutine[Any, Any, Unknown]`, found `Awaitable[T@EageriseBoostable]`
+ boostedblob/boost.py:544:61 error[invalid-argument-type] Argument to function `create_task` is incorrect: Expected `Generator[Any, None, T@EageriseBoostable] | Coroutine[Any, Any, T@EageriseBoostable]`, found `Awaitable[T@EageriseBoostable]`

build (https://github.com/pypa/build)
- tests/test_integration.py:149:17 error[no-matching-overload] No overload of constructor `filter.__new__` matches arguments
- tests/test_integration.py:150:17 error[no-matching-overload] No overload of constructor `filter.__new__` matches arguments

core (https://github.com/home-assistant/core)
- homeassistant/helpers/entity_registry.py:2391:9 error[invalid-argument-type] Argument to bound method `EventBus.async_listen` is incorrect: Expected `(Event[EventCategoryRegistryUpdatedData | EventLabelRegistryUpdatedData], /) -> Coroutine[Any, Any, None] | None`, found `def _handle_category_registry_update(event: EventCategoryRegistryUpdated) -> None`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/contrib/internal/subprocess/patch.py:364:37 error[invalid-argument-type] Argument to bound method `list.extend` is incorrect: Expected `Iterable[str]`, found `list[_T@deque | str]`

discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/core.py:2025:31 error[invalid-argument-type] Argument to `CheckAnyFailure.__init__` is incorrect: Expected `list[(Context[Unknown], /) -> bool]`, found `list[(ContextT@check_any, /) -> Coroutine[Any, Any, bool]]`

django-stubs (https://github.com/typeddjango/django-stubs)
+ tests/assert_type/utils/test_encoding.py:23:5 error[type-assertion-failure] Type `Unknown` does not match asserted type `int`

hydpy (https://github.com/hydpy-dev/hydpy)
- hydpy/core/parametertools.py:3926:45 error[not-subscriptable] Cannot subscript object of type `float` with no `__getitem__` method

jax (https://github.com/google/jax)
- jax/_src/scipy/sparse/linalg.py:189:14 error[invalid-argument-type] Argument to function `safe_map` is incorrect: Expected `(_SupportsShape[Never] | int | float | ... omitted 7 union elements, /) -> tuple[Any, ...] | tuple[int] | tuple[int, int] | tuple[int, int, int]`, found `Overload[(a: _SupportsShape[Never]) -> tuple[Any, ...], [_ShapeT](a: _SupportsShape[_ShapeT]) -> _ShapeT, (a: int | float | complex | bytes | str) -> tuple[()], [_PyScalarT](a: list[_PyScalarT] | tuple[_PyScalarT, ...]) -> tuple[int], [_PyScalarT](a: Sequence[list[_PyScalarT] | tuple[_PyScalarT, ...]]) -> tuple[int, int], [_PyScalarT](a: Sequence[Sequence[list[_PyScalarT] | tuple[_PyScalarT, ...]]]) -> tuple[int, int, int], (a: memoryview[int] | bytearray) -> tuple[int], (a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements) -> tuple[Any, ...]]`
- jax/_src/pmap.py:922:21 error[unresolved-attribute] Attribute `_rewrap_with_aval_and_sharding` is not defined on `ndarray[tuple[Any, ...], dtype[Unknown]]` in union `Any | ndarray[tuple[Any, ...], dtype[Unknown]]`
+ jax/_src/pmap.py:922:21 error[unresolved-attribute] Attribute `_rewrap_with_aval_and_sharding` is not defined on `ndarray[tuple[Any, ...], dtype[Unknown]]`, `ndarray[Unknown, dtype[Any]]` in union `Any | ndarray[tuple[Any, ...], dtype[Unknown]] | ndarray[Unknown, dtype[Any]]`
- jax/experimental/multihost_utils.py:292:30 error[unresolved-attribute] Attribute `_impl` is not defined on `dtype[Unknown]` in union `Unknown | dtype[Unknown]`
+ jax/experimental/multihost_utils.py:292:30 error[unresolved-attribute] Attribute `_impl` is not defined on `dtype[Unknown]`, `dtype[float64]` in union `Any | dtype[Unknown] | dtype[float64]`
- jax/experimental/multihost_utils.py:432:11 error[unresolved-attribute] Attribute `_base_array` is not defined on `ndarray[tuple[Any, ...], dtype[Unknown]]` in union `Unknown | ndarray[tuple[Any, ...], dtype[Unknown]]`
+ jax/experimental/multihost_utils.py:432:11 error[unresolved-attribute] Attribute `_base_array` is not defined on `ndarray[tuple[Any, ...], dtype[Unknown]]`, `ndarray[Unknown, dtype[float64]]` in union `(Any & <Protocol with members 'shape'>) | ndarray[tuple[Any, ...], dtype[Unknown]] | ndarray[Unknown, dtype[float64]]`

materialize (https://github.com/MaterializeInc/materialize)
- test/sql-server-cdc/mzcompose.py:126:18 error[invalid-argument-type] Argument to bound method `Composition.test_parts` is incorrect: Expected `list[str | Path]`, found `list[str]`

meson (https://github.com/mesonbuild/meson)
+ mesonbuild/dependencies/cuda.py:137:76 error[invalid-argument-type] Argument to function `version_compare_many` is incorrect: Expected `str`, found `str | None`
- mesonbuild/interpreter/type_checking.py:180:63 error[invalid-assignment] Object of type `KwargInfo[list[str | int] | None]` is not assignable to `KwargInfo[list[str | int]]`

mypy (https://github.com/python/mypy)
- mypy/build.py:5118:38 error[invalid-argument-type] Argument to function `is_sub_path_normabs` is incorrect: Expected `str`, found `PathLike[PathLike[Never] | str] | str`
- mypy/modulefinder.py:478:57 error[invalid-argument-type] Argument to function `os_path_join` is incorrect: Expected `str`, found `PathLike[PathLike[Never] | str] | str`

openlibrary (https://github.com/internetarchive/openlibrary)
- openlibrary/utils/ddc.py:172:12 error[invalid-return-type] Return type does not match returned value: expected `str`, found `Sized`

packaging (https://github.com/pypa/packaging)
- src/packaging/specifiers.py:842:13 error[invalid-assignment] Object of type `tuple[Specifier | Buffer, ...]` is not assignable to attribute `_specs` of type `tuple[Specifier, ...]`

pandas (https://github.com/pandas-dev/pandas)
- pandas/tests/scalar/interval/test_contains.py:37:16 error[unsupported-operator] Operator `in` is not supported between objects of type `Interval[int]` and `Interval[int | float]`
- pandas/tests/scalar/interval/test_contains.py:45:16 error[unsupported-operator] Operator `in` is not supported between objects of type `Interval[int | float]` and `Interval[int]`
- pandas/tests/scalar/interval/test_contains.py:46:47 error[unsupported-operator] Operator `not in` is not supported between objects of type `Interval[int | float]` and `Interval[int]`
- pandas/core/arrays/boolean.py:261:24 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | None | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | ndarray[tuple[Any, ...], dtype[Any]]`
+ pandas/core/arrays/boolean.py:261:24 error[unresolved-attribute] Attribute `shape` is not defined on `None` in union `Unknown | ndarray[Unknown, dtype[Any]] | None | ndarray[tuple[Any, ...], dtype[numpy.bool[builtins.bool]]] | ndarray[tuple[Any, ...], dtype[Any]]`
- pandas/core/arrays/interval.py:1571:50 error[invalid-argument-type] Argument to `Interval.__init__` is incorrect: Expected `int`, found `Period | Timestamp | Timedelta | NaTType | Any`
- pandas/core/internals/construction.py:259:22 error[unresolved-attribute] Attribute `reshape` is not defined on `ExtensionArray` in union `Unknown | ndarray[tuple[int, int], dtype[Any]] | ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]]`
+ pandas/core/internals/construction.py:259:22 error[unresolved-attribute] Attribute `reshape` is not defined on `ExtensionArray` in union `Unknown | ndarray[Unknown, dtype[Any]] | ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]]`
- pandas/tests/scalar/interval/test_arithmetic.py:92:13 error[unsupported-operator] Operator `/` is not supported between objects of type `Interval[int]` and `Literal["foo"]`
+ pandas/tests/scalar/interval/test_arithmetic.py:92:13 error[unsupported-operator] Operator `/` is not supported between objects of type `Interval[Unknown]` and `Literal["foo"]`
- pandas/tests/scalar/interval/test_arithmetic.py:107:13 error[unsupported-operator] Operator `//` is not supported between two objects of type `Interval[int]`
+ pandas/tests/scalar/interval/test_arithmetic.py:107:13 error[unsupported-operator] Operator `//` is not supported between two objects of type `Interval[Unknown]`

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/indexes/bool/test_add.py:24:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float | complex]`
- tests/indexes/bool/test_add.py:24:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Index[bool]` and `complex`
- tests/indexes/bool/test_add.py:29:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float | complex]`
- tests/indexes/bool/test_add.py:39:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float | complex]`
- tests/indexes/bool/test_add.py:23:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float]`
+ tests/indexes/bool/test_add.py:23:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
- tests/indexes/bool/test_add.py:36:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[bool]`
+ tests/indexes/bool/test_add.py:36:11 error[type-assertion-failure] Type `Index[int]` does not match asserted type `Index[bool]`
- tests/indexes/bool/test_mul.py:49:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float]`
- tests/indexes/bool/test_mul.py:49:23 error[unsupported-operator] Operator `*` is not supported between objects of type `float` and `Index[bool]`
- tests/indexes/bool/test_mul.py:64:23 error[unsupported-operator] Operator `*` is not supported between objects of type `Index[bool]` and `list[int | float]`
- tests/indexes/bool/test_mul.py:71:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int]`
- tests/indexes/bool/test_truediv.py:33:11 error[type-assertion-failure] Type `Index[int | float]` does not match asserted type `Index[int | float | complex]`
- tests/indexes/bool/test_truediv.py:40:11 error[type-assertion-failure] Type `Index[int | float]` does not match asserted type `Index[int | float | complex]`
+ tests/indexes/float/test_add.py:24:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
- tests/indexes/float/test_add.py:27:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float]`
+ tests/indexes/float/test_add.py:27:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
- tests/indexes/float/test_add.py:27:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Literal[True]` and `Index[int | float]`
- tests/indexes/float/test_mul.py:43:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float | complex]`
+ tests/indexes/float/test_truediv.py:34:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int | float]`
+ tests/indexes/int/test_add.py:28:11 error[type-assertion-failure] Type `Index[int | float | complex]` does not match asserted type `Index[int]`
- tests/indexes/int/test_mul.py:50:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float]`
- tests/indexes/int/test_mul.py:51:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Index[int | float | complex]`
- tests/indexes/int/test_truediv.py:37:11 error[type-assertion-failure] Type `Index[int | float]` does not match asserted type `Index[int | float | complex]`
- tests/indexes/str/test_add.py:31:14 error[unsupported-operator] Operator `+` is not supported between objects of type `Index[str]` and `Literal[4]`
- tests/scalars/test_scalars.py:1678:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Period` and `Series[Timedelta]`
- tests/series/bool/test_add.py:24:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Series[bool]` and `complex`
- tests/series/bool/test_add.py:34:23 error[no-matching-overload] No overload of bound method `Series.add` matches arguments
- tests/series/bool/test_add.py:51:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/bool/test_add.py:61:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/bool/test_add.py:67:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/bool/test_add.py:21:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Series[bool]` and `Literal[True]`
- tests/series/bool/test_add.py:23:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Series[bool]` and `float`
- tests/series/bool/test_add.py:27:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Literal[1]` and `Series[bool]`
- tests/series/bool/test_add.py:28:23 error[unsupported-operator] Operator `+` is not supported between objects of type `float` and `Series[bool]`
- tests/series/bool/test_add.py:33:23 error[no-matching-overload] No overload of bound method `Series.add` matches arguments
- tests/series/bool/test_add.py:36:23 error[no-matching-overload] No overload of bound method `Series.radd` matches arguments
- tests/series/bool/test_add.py:37:23 error[no-matching-overload] No overload of bound method `Series.radd` matches arguments
- tests/series/bool/test_add.py:59:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int]`
+ tests/series/bool/test_add.py:59:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int]`
- tests/series/bool/test_add.py:60:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
+ tests/series/bool/test_add.py:60:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/bool/test_add.py:65:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
+ tests/series/bool/test_add.py:65:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/bool/test_mul.py:42:23 error[unsupported-operator] Operator `*` is not supported between objects of type `Series[bool]` and `float`
- tests/series/bool/test_mul.py:43:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/bool/test_mul.py:58:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/bool/test_mul.py:59:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/bool/test_mul.py:66:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/bool/test_mul.py:83:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/bool/test_mul.py:90:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int]`
- tests/series/bool/test_mul.py:90:23 error[unsupported-operator] Operator `*` is not supported between objects of type `list[int]` and `Series[bool]`
- tests/series/bool/test_mul.py:99:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/bool/test_mul.py:106:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int]`
- tests/series/bool/test_mul.py:48:23 error[unsupported-operator] Operator `*` is not supported between objects of type `Literal[True]` and `Series[bool]`
+ tests/series/bool/test_truediv.py:40:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/bool/test_truediv.py:58:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/complex/test_add.py:21:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Series[int | float | complex]` and `Literal[True]`
- tests/series/complex/test_add.py:37:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:40:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:43:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:43:21 error[no-matching-overload] No overload of bound method `Series.radd` matches arguments
- tests/series/complex/test_add.py:57:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:62:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:65:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/complex/test_add.py:76:9 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
- tests/series/float/test_add.py:29:23 error[unsupported-operator] Operator `+` is not supported between objects of type `complex` and `Series[int | float]`
- tests/series/float/test_add.py:34:23 error[no-matching-overload] No overload of bound method `Series.add` matches arguments
- tests/series/float/test_add.py:51:23 error[unsupported-operator] Operator `+` is not supported between objects of type `Series[int | float]` and `list[int | float | complex]`
- tests/series/float/test_add.py:61:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
+ tests/series/float/test_add.py:28:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/float/test_add.py:38:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/float/test_add.py:22:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
+ tests/series/float/test_add.py:22:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/float/test_add.py:55:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
+ tests/series/float/test_add.py:55:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/float/test_add.py:64:23 error[no-matching-overload] No overload of bound method `Series.radd` matches arguments
- tests/series/float/test_add.py:65:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
+ tests/series/float/test_add.py:65:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/float/test_add.py:65:23 error[no-matching-overload] No overload of bound method `Series.radd` matches arguments
+ tests/series/float/test_truediv.py:36:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/float/test_truediv.py:43:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
+ tests/series/float/test_truediv.py:45:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/int/test_add.py:34:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float | complex]`
+ tests/series/int/test_add.py:21:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int]`
+ tests/series/int/test_add.py:26:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int]`
+ tests/series/int/test_add.py:27:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int]`
- tests/series/int/test_mul.py:58:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
- tests/series/int/test_mul.py:66:11 error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[int | float]`
+ tests/series/int/test_truediv.py:43:11 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/str/test_add.py:70:9 error[no-matching-overload] No overload of bound method `Series.add` matches arguments
- tests/series/str/test_add.py:84:9 error[no-matching-overload] No overload of bound method `Series.radd` matches arguments
+ tests/series/test_series.py:885:9 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[int | float]`
- tests/series/timedelta/test_floordiv.py:71:9 error[no-matching-overload] No overload of bound method `Series.rfloordiv` matches arguments
- tests/series/timedelta/test_floordiv.py:72:9 error[no-matching-overload] No overload of bound method `Series.rfloordiv` matches arguments
- tests/series/timedelta/test_truediv.py:75:9 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments
- tests/series/timedelta/test_truediv.py:76:9 error[no-matching-overload] No overload of bound method `Series.rtruediv` matches arguments
+ tests/series/timedelta/test_truediv.py:55:9 error[type-assertion-failure] Type `Series[int | float | complex]` does not match asserted type `Series[Timedelta]`
- tests/test_natype.py:105:13 error[no-matching-overload] No overload of function `divmod` matches arguments

pip (https://github.com/pypa/pip)
- src/pip/_vendor/packaging/specifiers.py:1410:13 error[invalid-assignment] Object of type `tuple[Specifier | Buffer, ...]` is not assignable to attribute `_specs` of type `tuple[Specifier, ...]`
+ src/pip/_vendor/resolvelib/structs.py:206:12 error[invalid-return-type] Return type does not match returned value: expected `Iterable[CT@build_iter_view]`, found `_SequenceIterableView[RT@_SequenceIterableView]`

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/flow_run.py:269:20 error[unresolved-attribute] Attribute `is_scheduled` is not defined on `None` in union `State[Any] | None | UnspecializedTypeVar`
+ src/prefect/cli/flow_run.py:269:20 error[unresolved-attribute] Attribute `is_scheduled` is not defined on `None` in union `State[Any] | None`
- src/prefect/tasks.py:1214:16 error[no-matching-overload] No overload of function `run_task` matches arguments

pwndbg (https://github.com/pwndbg/pwndbg)
- pwndbg/enhance.py:174:16 error[invalid-return-type] Return type does not match returned value: expected `str`, found `UnspecializedTypeVar | str | None`
+ pwndbg/enhance.py:174:16 error[invalid-return-type] Return type does not match returned value: expected `str`, found `Unknown | str | None`

scikit-learn (https://github.com/scikit-learn/scikit-learn)
+ sklearn/manifold/_locally_linear.py:441:34 error[unresolved-attribute] Attribute `tocsr` is not defined on `ndarray[Unknown, Unknown]` in union `Unknown | lil_array[Any] | ndarray[Unknown, Unknown]`
- sklearn/tree/tests/test_tree.py:778:35 error[unresolved-attribute] Attribute `tocsr` is not defined on `ndarray[tuple[Any, ...], Unknown]`, `ndarray[tuple[int, int], Unknown]` in union `Unknown | ndarray[tuple[Any, ...], Unknown] | ndarray[tuple[int, int], Unknown]`
+ sklearn/tree/tests/test_tree.py:778:35 error[unresolved-attribute] Attribute `tocsr` is not defined on `ndarray[tuple[Any, ...], Unknown]`, `ndarray[Unknown, Unknown]` in union `Unknown | ndarray[tuple[Any, ...], Unknown] | ndarray[Unknown, Unknown]`

scipy (https://github.com/scipy/scipy)
- scipy/optimize/_nonlin.py:1356:19 error[unresolved-attribute] Attribute `conj` is not defined on `None` in union `None | Unknown`
+ scipy/optimize/_nonlin.py:1356:19 error[unresolved-attribute] Attribute `conj` is not defined on `None` in union `None | ndarray[Unknown, Unknown]`
- scipy/optimize/_nonlin.py:1359:19 error[unresolved-attribute] Attribute `conj` is not defined on `None` in union `None | Unknown`
+ scipy/optimize/_nonlin.py:1359:19 error[unresolved-attribute] Attribute `conj` is not defined on `None` in union `None | ndarray[Unknown, Unknown]`
- scipy/sparse/tests/test_base.py:2474:35 error[unresolved-attribute] Object of type `ndarray[tuple[int, int], dtype[float64]]` has no attribute `toarray`
+ scipy/sparse/tests/test_base.py:2474:35 error[unresolved-attribute] Object of type `ndarray[Unknown, dtype[float64]]` has no attribute `toarray`

scipy-stubs (https://github.com/scipy/scipy-stubs)
- tests/interpolate/test_polyint.pyi:33:1 error[type-assertion-failure] Type `KroghInterpolator[float64, Any]` does not match asserted type `KroghInterpolator[float64, signedinteger[_32Bit]]`
+ tests/interpolate/test_polyint.pyi:33:1 error[type-assertion-failure] Type `KroghInterpolator[float64, Never]` does not match asserted type `KroghInterpolator[float64, signedinteger[_32Bit]]`
- tests/sparse/test_csr.pyi:58:1 error[type-assertion-failure] Type `csr_array[Any, tuple[int, int]]` does not match asserted type `csr_array[float64, tuple[int]]`
+ tests/sparse/test_csr.pyi:58:1 error[type-assertion-failure] Type `csr_array[Never, tuple[int, int]]` does not match asserted type `csr_array[float64, tuple[int]]`
- tests/sparse/test_csr.pyi:76:1 error[type-assertion-failure] Type `csr_array[Any, tuple[int, int]]` does not match asserted type `csr_array[signedinteger[_64Bit], tuple[int, int]]`
+ tests/sparse/test_csr.pyi:76:1 error[type-assertion-failure] Type `csr_array[Never, tuple[int, int]]` does not match asserted type `csr_array[signedinteger[_64Bit], tuple[int, int]]`
- tests/sparse/test_csr.pyi:87:1 error[type-assertion-failure] Type `csr_array[Any, tuple[int, int]]` does not match asserted type `csr_array[floating[_32Bit], tuple[int, int]]`
+ tests/sparse/test_csr.pyi:87:1 error[type-assertion-failure] Type `csr_array[Never, tuple[int, int]]` does not match asserted type `csr_array[floating[_32Bit], tuple[int, int]]`
- tests/sparse/test_csr.pyi:91:1 error[type-assertion-failure] Type `csr_array[Any, tuple[int, int]]` does not match asserted type `csr_array[float64, tuple[int, int]]`
+ tests/sparse/test_csr.pyi:91:1 error[type-assertion-failure] Type `csr_array[Never, tuple[int, int]]` does not match asserted type `csr_array[float64, tuple[int, int]]`

setuptools (https://github.com/pypa/setuptools)
- setuptools/_distutils/command/sdist.py:292:34 error[invalid-argument-type] Argument to bound method `FileList.extend` is incorrect: Expected `Iterable[str]`, found `filter[int | str | bytes | PathLike[str] | PathLike[bytes]]`
- setuptools/discovery.py:557:16 error[invalid-assignment] Object of type `list[Sized]` is not assignable to `list[str]`
- setuptools/msvc.py:1463:16 error[invalid-return-type] Return type does not match returned value: expected `str | None`, found `int | str | bytes | ... omitted 3 union elements`

spack (https://github.com/spack/spack)
- lib/spack/spack/verify_libraries.py:170:69 error[invalid-argument-type] Argument to `Problem.__init__` is incorrect: Expected `list[bytes]`, found `list[bytes | Unknown | str | PathLike[str] | PathLike[bytes]]`
+ lib/spack/spack/test/util/log_parser.py:118:35 error[invalid-argument-type] Argument to function `make_log_context` is incorrect: Expected `list[LogEvent]`, found `list[BuildError | BuildWarning]`
- lib/spack/spack/detection/common.py:378:20 error[no-matching-overload] No overload of constructor `filter.__new__` matches arguments
- lib/spack/spack/llnl/util/filesystem.py:1789:24 error[no-matching-overload] No overload of function `basename` matches arguments
- lib/spack/spack/llnl/util/filesystem.py:1791:25 error[invalid-argument-type] Argument to function `move` is incorrect: Expected `str | PathLike[str]`, found `Sized`
- lib/spack/spack/util/elf.py:615:29 error[invalid-argument-type] Argument to bound method `bytes.join` is incorrect: Expected `Iterable[Buffer]`, found `list[Sized]`
- var/spack/test_repos/spack_repo/builtin_mock/build_systems/compiler.py:148:16 error[invalid-return-type] Return type does not match returned value: expected `dict[str, str | Path]`, found `dict[Sized, str | Path]`

sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/ext/autosummary/generate.py:664:57 error[unresolved-attribute] Attribute `name` is not defined on `Buffer` in union `AutosummaryEntry | Buffer`
- sphinx/ext/autosummary/generate.py:692:13 error[unresolved-attribute] Attribute `template` is not defined on `Buffer` in union `AutosummaryEntry | Buffer`

static-frame (https://github.com/static-frame/static-frame)
- static_frame/core/store_sqlite.py:85:34 error[invalid-argument-type] Argument to function `register_adapter` is incorrect: Expected `type[SupportsInt | str | Buffer | SupportsIndex | SupportsTrunc]`, found `<class 'signedinteger[_32Bit]'>`
- static_frame/core/store_sqlite.py:86:34 error[invalid-argument-type] Argument to function `register_adapter` is incorrect: Expected `type[SupportsInt | str | Buffer | SupportsIndex | SupportsTrunc]`, found `<class 'signedinteger[_16Bit]'>`

sympy (https://github.com/sympy/sympy)
- sympy/simplify/cse_main.py:306:16 error[unsupported-operator] Operator `in` is not supported between objects of type `Unknown` and `Unknown | Sized`
- sympy/solvers/polysys.py:837:28 error[not-iterable] Object of type `Sized` is not iterable
- sympy/solvers/polysys.py:851:28 error[not-iterable] Object of type `Sized` is not iterable
- sympy/algebras/tests/test_quaternion.py:76:10 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/codegen/tests/test_matrix_nodes.py:27:37 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/core/mul.py:572:13 error[no-matching-overload] No overload of bound method `MutableMapping.setdefault` matches arguments
- sympy/functions/combinatorial/factorials.py:968:29 error[unresolved-attribute] Attribute `is_nonnegative` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`
- sympy/functions/combinatorial/factorials.py:969:12 error[unresolved-attribute] Attribute `is_zero` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`
- sympy/functions/combinatorial/factorials.py:967:13 error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:967:13 error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | Unknown`
- sympy/functions/combinatorial/factorials.py:986:53 error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | int | float | complex | Any`
+ sympy/functions/combinatorial/factorials.py:986:53 error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | Unknown`
- sympy/geometry/polygon.py:1510:40 error[unresolved-attribute] Attribute `is_number` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`
+ sympy/geometry/polygon.py:1510:40 error[unresolved-attribute] Attribute `is_number` is not defined on `int` in union `Basic | Unknown | int`
- sympy/matrices/expressions/hadamard.py:82:22 error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Basic | int | float | complex | Any`
+ sympy/matrices/expressions/hadamard.py:82:22 error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Basic | Unknown`
- sympy/matrices/expressions/kronecker.py:111:33 error[unresolved-attribute] Attribute `rows` is not defined on `Basic`, `int`, `float`, `complex` in union `Basic | int | float | complex | Any`
+ sympy/matrices/expressions/kronecker.py:111:33 error[unresolved-attribute] Attribute `rows` is not defined on `Basic` in union `Basic | Unknown`
- sympy/matrices/expressions/matadd.py:61:22 error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Unknown | Basic | int | float | complex`
+ sympy/matrices/expressions/matadd.py:61:22 error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Unknown | Basic`
- sympy/matrices/inverse.py:393:19 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MatrixBase | Expr`
+ sympy/matrices/inverse.py:383:13 error[unsupported-operator] Operator `*` is not supported between two objects of type `MatrixBase`
+ sympy/matrices/inverse.py:391:10 error[unsupported-operator] Operator `*` is not supported between two objects of type `MatrixBase`
- sympy/matrices/matrixbase.py:2955:13 error[unsupported-operator] Operator `*=` is not supported between objects of type `T1'return@call_highest_priority` and `Self@_eval_pow_by_cayley`
+ sympy/matrices/matrixbase.py:2955:13 error[unsupported-operator] Operator `*=` is not supported between two objects of type `Self@_eval_pow_by_cayley`
- sympy/matrices/matrixbase.py:2955:13 error[unsupported-operator] Operator `*=` is not supported between objects of type `T2'return@call_highest_priority` and `Self@_eval_pow_by_cayley`
- sympy/matrices/matrixbase.py:3942:30 error[invalid-argument-type] Argument to bound method `list.append` is incorrect: Expected `Self@berkowitz`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/matrixbase.py:3954:26 error[unsupported-operator] Operator `*` is not supported between objects of type `int | MatrixBase` and `MatrixBase`
- sympy/matrices/matrixbase.py:4640:16 error[invalid-return-type] Return type does not match returned value: expected `Self@D`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/matrixbase.py:4922:13 error[unsupported-operator] Operator `*=` is not supported between objects of type `T2'return@call_highest_priority` and `Self@analytic_func`
- sympy/matrices/matrixbase.py:5076:19 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `Self@log`
+ sympy/matrices/matrixbase.py:5076:19 error[unsupported-operator] Operator `*` is not supported between two objects of type `Self@log`
- sympy/matrices/solvers.py:637:27 error[invalid-argument-type] Argument to bound method `MatrixBase.vstack` is incorrect: Argument type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown` does not satisfy upper bound `MatrixBase` of type variable `Self`
- sympy/matrices/solvers.py:637:27 error[invalid-argument-type] Argument to bound method `MatrixBase.vstack` is incorrect: Expected `Tmat@_gauss_jordan_solve`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
- sympy/matrices/solvers.py:976:16 error[unresolved-attribute] Attribute `solve` is not defined on `T2'return@call_highest_priority`, `T1'return@call_highest_priority`, `Expr` in union `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/solvers.py:976:16 error[invalid-return-type] Return type does not match returned value: expected `Tmat@_solve_least_squares`, found `MatrixBase`
- sympy/matrices/tests/test_decompositions.py:394:25 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:395:25 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:112:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:113:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:154:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:176:17 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:201:17 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:215:17 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:259:17 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:263:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:271:17 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:404:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:426:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:58:12 error[unresolved-attribute] Attribute `permute_rows` is not defined on `T2'return@call_highest_priority`, `T1'return@call_highest_priority`, `Expr` in union `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_decompositions.py:131:12 error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_decompositions.py:356:23 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:356:23 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:437:21 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:449:21 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_decompositions.py:450:21 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_decompositions.py:462:12 error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_eigen.py:393:15 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `ImmutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:443:26 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_eigen.py:320:14 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:320:14 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_eigen.py:378:14 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_eigen.py:378:14 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrices.py:202:12 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:203:12 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:214:16 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:215:16 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:216:16 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:217:16 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:218:16 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:219:16 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrices.py:2682:25 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_matrices.py:3478:12 error[unresolved-attribute] Attribute `rank` is not defined on `T2'return@call_highest_priority`, `T1'return@call_highest_priority` in union `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
+ sympy/matrices/tests/test_matrices.py:985:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1017:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2555:21 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:2728:15 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:3034:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrices.py:1740:21 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrices.py:1740:21 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:968:12 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrixbase.py:969:12 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_matrixbase.py:3386:25 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:3388:16 error[unresolved-attribute] Attribute `H` is not defined on `T2'return@call_highest_priority`, `T1'return@call_highest_priority`, `Expr` in union `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_matrixbase.py:3433:16 error[unresolved-attribute] Attribute `H` is not defined on `T2'return@call_highest_priority`, `T1'return@call_highest_priority`, `Expr` in union `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/matrices/tests/test_matrixbase.py:963:9 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:1746:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:1778:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:1149:16 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:1149:16 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:2358:12 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2358:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:2366:12 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2366:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_matrixbase.py:2375:12 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_matrixbase.py:2375:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_solvers.py:130:12 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- sympy/matrices/tests/test_solvers.py:130:12 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_solvers.py:130:12 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_solvers.py:133:12 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- sympy/matrices/tests/test_solvers.py:133:12 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_solvers.py:342:25 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
- sympy/matrices/tests/test_solvers.py:343:25 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:90:9 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:117:9 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:189:9 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_solvers.py:201:12 error[no-matching-overload] No overload of function `simplify` matches arguments
- sympy/matrices/tests/test_solvers.py:315:12 error[unsupported-operator] Operator `*` is not supported between objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` and `MutableDenseMatrix`
+ sympy/matrices/tests/test_solvers.py:315:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/matrices/tests/test_sparse.py:92:12 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- sympy/matrices/tests/test_sparse.py:93:12 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/matrices/tests/test_sparse.py:105:16 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- sympy/matrices/tests/test_sparse.py:108:16 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
+ sympy/matrices/tests/test_sparse.py:381:12 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableSparseMatrix`
- sympy/matrices/tests/test_sparse.py:337:12 error[unresolved-attribute] Attribute `permute_rows` is not defined on `T2'return@call_highest_priority`, `T1'return@call_highest_priority`, `Expr` in union `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/matrices/tests/test_subspaces.py:48:35 error[not-iterable] Object of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr` is not iterable
+ sympy/matrices/tests/test_subspaces.py:48:35 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/physics/mechanics/tests/test_kane.py:444:38 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method
- sympy/physics/optics/gaussopt.py:137:26 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/physics/optics/gaussopt.py:757:25 error[unresolved-attribute] Attribute `is_infinite` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`
- sympy/physics/optics/gaussopt.py:758:21 error[unresolved-attribute] Attribute `is_infinite` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`
- sympy/physics/optics/gaussopt.py:760:21 error[unsupported-operator] Operator `+` is not supported between two objects of type `Basic | int | float | complex | Any`
+ sympy/physics/optics/gaussopt.py:760:21 error[unsupported-operator] Operator `+` is not supported between two objects of type `Basic | Unknown`
- sympy/physics/optics/gaussopt.py:838:41 error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | int | float | complex | Any`
+ sympy/physics/optics/gaussopt.py:838:41 error[unsupported-operator] Operator `-` is not supported between two objects of type `Basic | Unknown`
- sympy/physics/optics/gaussopt.py:888:9 error[unsupported-operator] Operator `/` is not supported between two objects of type `Basic | int | float | complex | Any`
+ sympy/physics/optics/gaussopt.py:888:9 error[unsupported-operator] Operator `/` is not supported between two objects of type `Basic | Unknown`
- sympy/physics/optics/tests/test_gaussopt.py:43:21 error[not-subscriptable] Cannot subscript object of type `T2'return@call_highest_priority` with no `__getitem__` method
- sympy/physics/quantum/cg.py:259:34 error[invalid-argument-type] Argument to constructor `Expr.__new__` is incorrect: Expected `Basic`, found `Basic | int | float | complex | Any`
+ sympy/physics/quantum/tests/test_represent.py:84:26 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/physics/quantum/tests/test_represent.py:94:40 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/physics/vector/functions.py:381:21 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Unknown`
+ sympy/physics/vector/functions.py:381:21 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `MatrixBase`
- sympy/series/order.py:154:20 error[unresolved-attribute] Attribute `is_symbol` is not defined on `int`, `float`, `complex` in union `Unknown | Basic | int | float | complex`
- sympy/series/order.py:289:48 error[unsupported-operator] Operator `**` is not supported between objects of type `Basic | int | float | complex | Any` and `Basic`
+ sympy/series/order.py:289:48 error[unsupported-operator] Operator `**` is not supported between objects of type `Basic | Unknown` and `Basic`
- sympy/simplify/hyperexpand.py:1217:19 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`
+ sympy/simplify/hyperexpand.py:1217:19 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | Unknown`
- sympy/simplify/hyperexpand.py:1316:19 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`
+ sympy/simplify/hyperexpand.py:1316:19 error[invalid-argument-type] Argument to `list.__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | Unknown`
- sympy/solvers/recurr.py:437:24 error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`
+ sympy/solvers/tests/test_solvers.py:721:21 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
+ sympy/solvers/tests/test_solvers.py:729:27 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/solvers/tests/test_solvers.py:723:19 error[unsupported-operator] Operator `-` is not supported between two objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/solvers/tests/test_solvers.py:723:19 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/solvers/tests/test_solvers.py:725:19 error[unsupported-operator] Operator `-` is not supported between two objects of type `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
+ sympy/solvers/tests/test_solvers.py:725:19 error[unsupported-operator] Operator `*` is not supported between two objects of type `MutableDenseMatrix`
- sympy/stats/stochastic_process_types.py:1613:15 error[unresolved-attribute] Attribute `tolist` is not defined on `T2'return@call_highest_priority`, `T1'return@call_highest_priority`, `Expr` in union `T2'return@call_highest_priority | T1'return@call_highest_priority | MatrixBase | Expr`
- sympy/stats/symbolic_probability.py:533:55 error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Basic | Unknown`
+ sympy/stats/symbolic_probability.py:533:55 error[unresolved-attribute] Object of type `Basic` has no attribute `expand`
- sympy/utilities/codegen.py:974:32 error[not-iterable] Object of type `Buffer` is not iterable
- sympy/utilities/codegen.py:1476:27 error[not-iterable] Object of type `Buffer` is not iterable
- sympy/vector/tests/test_vector.py:108:12 error[not-subscriptable] Cannot subscript object of type `T1'return@call_highest_priority` with no `__getitem__` method
- sympy/vector/tests/test_vector.py:109:23 error[not-subscriptable] Cannot subscript object of type `Expr` with no `__getitem__` method

vision (https://github.com/pytorch/vision)
- test/datasets_utils.py:1045:18 error[invalid-assignment] Object of type `str` is not assignable to `tuple[str, ...]`
+ test/datasets_utils.py:1045:18 error[invalid-assignment] Object of type `LiteralString` is not assignable to `tuple[str, ...]`

werkzeug (https://github.com/pallets/werkzeug)
- src/werkzeug/_reloader.py:149:22 error[not-iterable] Object of type `Sized` is not iterable
- src/werkzeug/utils.py:506:43 warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive

xarray (https://github.com/pydata/xarray)
+ xarray/tests/test_plot.py:1637:20 error[unresolved-attribute] Object of type `_ScalarT@__init__` has no attribute `has_data`
+ xarray/tests/test_plot.py:1639:31 error[unresolved-attribute] Object of type `_ScalarT@__init__` has no attribute `get_ylabel`
+ xarray/tests/test_plot.py:1651:20 error[unresolved-attribute] Object of type `_ScalarT@__init__` has no attribute `has_data`
+ xarray/tests/test_plot.py:1653:31 error[unresolved-attribute] Object of type `_ScalarT@__init__` has no attribute `get_ylabel`

Full report with detailed diff (timing results)

@codspeed-hq

codspeed-hq Bot commented Apr 10, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 36%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

❌ 19 (👁 19) regressed benchmarks
✅ 104 untouched benchmarks
🆕 2 new benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
👁 Simulation ty_check_file[cold] 150.8 ms 164 ms -8.04%
👁 Simulation ty_check_file[incremental] 8 ms 8.8 ms -8.66%
👁 Simulation DateType 220.9 ms 232.6 ms -5.05%
👁 Simulation attrs 511.1 ms 600.1 ms -14.84%
👁 Simulation hydra-zen 1.1 s 3.5 s -68.1%
👁 Simulation anyio 1.2 s 1.4 s -12.85%
👁 WallTime multithreaded 1.1 s 2.3 s -52.46%
👁 WallTime freqtrade 8.2 s 11.3 s -28.08%
👁 WallTime altair 4.8 s 7.5 s -36.64%
👁 WallTime pydantic 7.9 s 35.1 s -77.51%
👁 Simulation ty_micro[typevar_mapping_accumulation] 319.5 ms 1,217.1 ms -73.75%
👁 Simulation ty_micro[typevar_mapping_small_accumulations] 181.9 ms 211.6 ms -14.04%
🆕 Simulation ty_micro[pydantic_core_schema_dict] N/A 420.3 ms N/A
👁 Memory ty_micro[typevar_mapping_accumulation] 32.4 MB 106 MB -69.4%
👁 Memory ty_micro[typevar_mapping_small_accumulations] 15.3 MB 16.4 MB -6.77%
🆕 Memory ty_micro[pydantic_core_schema_dict] N/A 20.8 MB N/A
👁 WallTime tanjun 3 s 3.6 s -17.78%
👁 WallTime pandas 64.3 s 82.6 s -22.08%
👁 WallTime sympy 74.3 s 92.4 s -19.64%
👁 WallTime colour_science 43.1 s 52.2 s -17.5%
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.


Comparing dcreager/spec-builder-constraint-set (486f853) with main (3856288)

Open in CodSpeed

@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from b4b898d to 4f1d1df Compare April 10, 2026 19:17
dcreager added a commit that referenced this pull request Apr 15, 2026
I discovered this while looking into ecosystem timeouts on
#24540. @AlexWaygood also found
this while trying to bump our vendored typeshed.

When solving a constraint set that contains multiple typevars, we
sometimes try to substitute a nested typevar in a constraint multiple
times, leading to an endless expansion.

In #24540, we saw this with
`streamlit`. Given constraints

```
Iterable[V_co] & int ≤ _T@list
ArrowStreamExportable & str ≤ _T@list
V_co = _T@list
```

Note that `V_co` is covariant, and `V_co = _T@list`, so we can
substitute any lower bound of `_T@list` into `Iterable` in the first
constraint. In particular, we can substitute `V_co =
ArrowStreamExportable & str`, giving

```
Iterable[ArrowStreamExportable & str] & int ≤ _T@list
```

That gives us another lower bound for `_T@list`, which we can substitute
again

```
Iterable[Iterable[ArrowStreamExportable & str] & int] & int ≤ _T@list
```

and on and on!

To catch this, we now keep track of when a new derived constraint comes
from a substitution. When walking paths in a constraint set, we do _not_
add a derived constraint if we already have some other constraint on the
path that came from the same substitution. In the `streamlit` example,
that means we will only substitute for `V_co` in the first constraint at
most once per BDD path.
@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from 4f1d1df to f677d97 Compare April 15, 2026 19:36
@MichaReiser MichaReiser added the ty Multi-file analysis & type inference label Apr 16, 2026
@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from f677d97 to 86a8963 Compare April 17, 2026 18:20
@dcreager dcreager changed the base branch from main to dcreager/cache-solutions April 17, 2026 18:21
@dcreager dcreager force-pushed the dcreager/cache-solutions branch from 8f9af08 to b4eaa43 Compare April 22, 2026 14:03
@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from 86a8963 to a2c1bd0 Compare April 22, 2026 14:03
Base automatically changed from dcreager/cache-solutions to main April 28, 2026 14:33
KotlinIsland pushed a commit to KotlinIsland/basedpython that referenced this pull request May 1, 2026
I discovered this while looking into ecosystem timeouts on
astral-sh/ruff#24540. @AlexWaygood also found
this while trying to bump our vendored typeshed.

When solving a constraint set that contains multiple typevars, we
sometimes try to substitute a nested typevar in a constraint multiple
times, leading to an endless expansion.

In astral-sh/ruff#24540, we saw this with
`streamlit`. Given constraints

```
Iterable[V_co] & int ≤ _T@list
ArrowStreamExportable & str ≤ _T@list
V_co = _T@list
```

Note that `V_co` is covariant, and `V_co = _T@list`, so we can
substitute any lower bound of `_T@list` into `Iterable` in the first
constraint. In particular, we can substitute `V_co =
ArrowStreamExportable & str`, giving

```
Iterable[ArrowStreamExportable & str] & int ≤ _T@list
```

That gives us another lower bound for `_T@list`, which we can substitute
again

```
Iterable[Iterable[ArrowStreamExportable & str] & int] & int ≤ _T@list
```

and on and on!

To catch this, we now keep track of when a new derived constraint comes
from a substitution. When walking paths in a constraint set, we do _not_
add a derived constraint if we already have some other constraint on the
path that came from the same substitution. In the `streamlit` example,
that means we will only substitute for `V_co` in the first constraint at
most once per BDD path.
@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch 3 times, most recently from a472de9 to 94469c6 Compare May 21, 2026 16:50
@dcreager

Copy link
Copy Markdown
Member Author

I'm going ahead and marking this as ready for review.

  • I've checked the ecosystem results (see above), and they look largely legit. (Either removed false positives, or existing behavioral gaps showing up in new locations.)

  • There are still unresolved performance regressions, the largest of which are in pydantic and hydra-zen. I'd like to address this in a follow-on PR. There is a TODO comment and new microbenchmark to track it.

  • One of the CodSpeed simulation microbenchmarks (pandas_tdd, from what I can tell) is now timing out in CI. I want to get this resolved before merging the PR, but I don't think it blocks starting code review. It's not clear to me what's happening, because the Python snippet in that microbenchmarks finishes quickly when I run ty on it in a standalone Python file, and also when I run ty inside of valgrind.

@dhruvmanila dhruvmanila left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! I've left a few comments and I'm able to follow the overall approach, but I haven't dug into all of the smaller details that could affect behavior. I think it would be useful for another reviewer to take a look as well, maybe @carljm or @sharkdp ?

Comment on lines 964 to +969

reveal_type(flatten("abc", (1, 2, 3))) # revealed: list[str | int]
# TODO: we could have `Literal["a", "b", "c"]` instead of `str` here
reveal_type(flatten_covariant("abc", (1, 2, 3))) # revealed: tuple[str | Literal[1, 2, 3], ...]
reveal_type(flatten("abc", (1, 2, 3))) # revealed: list[LiteralString | int]
reveal_type(flatten_covariant("abc", (1, 2, 3))) # revealed: tuple[LiteralString | Literal[1, 2, 3], ...]

def literal_string_case(literal_string: LiteralString):
reveal_type(flatten(literal_string, (1, 2, 3))) # revealed: list[str | int]
reveal_type(flatten(literal_string, (1, 2, 3))) # revealed: list[LiteralString | int]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I understand why does the type gets updated to LiteralString here shouldn't we still keep inferring list[str | int] in the following example:

def _(s: str) -> None:
    # this reveals `list[LiteralString | int]` on this branch
    reveal_type(flatten(s, (1, 2, 3)))

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ooh nice. I tracked this down to the overloads of str.__iter__, which includes:

    @overload
    def __iter__(self: LiteralString) -> Iterator[LiteralString]:

This adds LiteralString ≤ FlatT to the constraint set that we construct for this example. We should see that self is str, which is not assignable to LiteralString, and not consider this overload selectable when building up the constraint set. I've added this as a TODO to tackle in follow-on work.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to @charliermarsh 's PR #24707 -- though I'm not sure without looking more closely whether that PR alone will fix this, or we will need to do this separately in the generics solver.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a fix in here, though unsure if it belongs there: https://github.com/astral-sh/ruff/pull/24707/changes#r3309837520

Comment thread scripts/uv.lock Outdated
Comment on lines +2182 to +2198
let db = self.db;
let constraints = self.constraints;
let combined = actual_callable
.signatures(db)
.overloads
.iter()
.filter_map(|actual_signature| {
let when = actual_signature.when_constraint_set_assignable_to_signatures(
db,
formal_signature,
constraints,
);
self.add_type_mappings_from_constraint_set(when)
.ok()
.map(|()| when)
})
.reduce(|lhs, rhs| lhs.or(db, constraints, || rhs));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the thing that we talked about earlier where the overloads themselves would be ord with each other which will in turn help pick the correct overload when ParamSpec are involved?

Aside, I think the comment at the start of this else branch might require updating now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, though there's still a bit of transitional logic here. We were doing an or in spirit before, by returning Err if none of the overloads were individually satisfiable — where individual satisfiability was determined by whether we added any bindings via the old solver.

We now combine all of the per-overload constraint sets using or, which is what we will want in the end. But to stay close to the current behavior for now, we're still filter the overloads to remove ones that aren't individually satisfiable according to the old solver. Down the line, as part of removing the old solver's types field, we'll update this to check individual satisfiability by making sure that each per-overload constraint set is not never.

Comment on lines +1925 to +1937
for (identity, variable) in generic_context.variables_inner(self.db) {
if types.contains_key(identity) {
continue;
}

if let Some(mapped_ty) = self.types.get(identity).copied()
&& (mapped_ty.is_never()
|| (mapped_ty == Type::object()
&& variable.variance(self.db).is_contravariant()))
{
types.insert(*identity, mapped_ty);
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this some kind of special casing during the transition phase? I'm not able to follow in what scenario will there be no solution for these typevars if it's mapped to Never or object.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to #22400. In a constraint set, we are currently storing each individual constraint as lower ≤ T ≤ upper. That is, every constraint must have both a lower and an upper bound. If you really only want to create an upper bound, we use Never as the lower bound. But that means that we can't distinguish between "no lower bound" and "a lower bound of Never". That doesn't affect the set of solutions you'd get from the constraint set, but does affect the heuristics we want to use to choose one of those solutions. (In the first case, we want to ignore the Never, and in the second case, we probably want to use it.)

So for now, we assume that "ignore it" is the more likely thing we want to do.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, thanks for explaining. It might be useful to add a note / TODO comment.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment on lines +1943 to +1946
// TODO: This is a solution-level projection. A more principled version would live in the
// constraint-set solution extraction layer, taking an explicit domain of typevars to solve
// for and existentially quantifying away the other typevars in that domain.
if self.can_remove_inferable_typevar_artifacts(generic_context) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is for the "Generic callable chains" example in call/function.md, right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that's right. I added a comment pointing at the test

@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from baa79f1 to d69a1b8 Compare May 22, 2026 14:46
@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from d69a1b8 to 84ef6bc Compare May 22, 2026 19:47
@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from 84ef6bc to 4e0e8dc Compare May 22, 2026 20:10
@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from 4e0e8dc to a773c61 Compare May 23, 2026 00:32
@dcreager

Copy link
Copy Markdown
Member Author

The microbenchmark timeout was largely due to me having reverted the UnionAccumulator optimization in the types mapping. Once I restored that back from main the CI timeouts went away. That did not completely eliminate the regression, but mentioned above I think it's now in a range that we can accept here and address in follow-on PRs.

@dcreager dcreager force-pushed the dcreager/spec-builder-constraint-set branch from a773c61 to 486f853 Compare May 26, 2026 19:31
@dcreager

Copy link
Copy Markdown
Member Author

I think it would be useful for another reviewer to take a look as well,

In the interests of getting this landed, I plan on merging this if CI is still green after the latest review updates. If others want to review further, I can tackle any additional suggestions as follow-on work.

@dcreager dcreager merged commit 0f3ea5a into main May 26, 2026
93 of 94 checks passed
@dcreager dcreager deleted the dcreager/spec-builder-constraint-set branch May 26, 2026 19:56
anishgirianish pushed a commit to anishgirianish/ruff that referenced this pull request May 28, 2026
…stral-sh#24540)

This PR implements the bulk of the logic needed for
astral-sh/ty#2799, by building up a
`ConstraintSet` in `SpecializationBuilder`. This constraint set holds
the "pending state" of the specialization being inferred. It will
eventually _replace_ the `types` hash map, which stores a simple mapping
from typevars to inferred types, and which is always updated by unioning
together types when we find multiple solutions for a typevar.

For now, we are building up both pending state representations, and
solving from the constraint set where we can. There are two main cases
where we must fall back on the old solver:

- Any specialization that involves a `ParamSpec`
- If the constraint set returns `Unsatisfiable` or `Unconstrained`

Follow-on PRs will address these remaining cases that use the old
solver; once they are all migrated over to the constraint set solver, we
will remove the `types` field.

Closes astral-sh/ty#2572
Closes astral-sh/ty#2959
Closes astral-sh/ty#3037
Closes astral-sh/ty#3203
Closes astral-sh/ty#3228
Closes astral-sh/ty#3428
Closes astral-sh/ty#3483
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

6 participants