You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this PR, I implement one of the slowdown mitigation measures I came up with. The actual inference of the loop variable is done in two places: infer_loop_header_definition and place_from_bindings_impl (the LoopHeader branch). Reachability analysis is performed independently here, but this calculation is very expensive and should be cached. Therefore, I add a tracked function loop_header_reachability.
This change has resulted in a 12-19% performance improvement for isort locally.
Changes were detected when running on open source projects
spack (https://github.com/spack/spack)
- lib/spack/spack/llnl/util/filesystem.py:1668:35: error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `Sized | Unknown`+ lib/spack/spack/llnl/util/filesystem.py:1668:35: error[invalid-argument-type] Argument to function `exists` is incorrect: Expected `int | str | bytes | PathLike[str] | PathLike[bytes]`, found `Unknown | Sized`- lib/spack/spack/llnl/util/filesystem.py:1674:25: error[invalid-argument-type] Argument to function `move` is incorrect: Expected `str | PathLike[str]`, found `Sized | Unknown`+ lib/spack/spack/llnl/util/filesystem.py:1674:25: error[invalid-argument-type] Argument to function `move` is incorrect: Expected `str | PathLike[str]`, found `Unknown | Sized`
pip (https://github.com/pypa/pip)
- src/pip/_internal/req/req_uninstall.py:132:42: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Unknown | Sized`+ src/pip/_internal/req/req_uninstall.py:132:42: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Sized | Unknown`- src/pip/_internal/req/req_uninstall.py:133:40: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Unknown | Sized`+ src/pip/_internal/req/req_uninstall.py:133:40: error[invalid-argument-type] Argument to function `norm_join` is incorrect: Expected `str`, found `Sized | Unknown`- src/pip/_internal/req/req_uninstall.py:139:27: error[unsupported-operator] Operator `+` is not supported between objects of type `Unknown | Sized` and `LiteralString`+ src/pip/_internal/req/req_uninstall.py:139:27: error[unsupported-operator] Operator `+` is not supported between objects of type `Sized | Unknown` and `LiteralString`
rich (https://github.com/Textualize/rich)
- tests/test_tools.py:17:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`+ tests/test_tools.py:17:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`- tests/test_tools.py:18:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`+ tests/test_tools.py:18:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`- tests/test_tools.py:19:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`+ tests/test_tools.py:19:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`- tests/test_tools.py:20:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, str | Unknown]]`+ tests/test_tools.py:20:17: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Iterable[tuple[bool, Unknown | str]]`
pydantic (https://github.com/pydantic/pydantic)
- pydantic/_internal/_core_metadata.py:87:54: error[invalid-assignment] Invalid assignment to key "pydantic_js_extra" with declared type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | ((dict[str, Divergent], type[Any], /) -> None)` on TypedDict `CoreMetadata`: value of type `dict[object, object]`+ pydantic/_internal/_core_metadata.py:87:54: error[invalid-assignment] Invalid assignment to key "pydantic_js_extra" with declared type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | ((dict[str, int | float | str | ... omitted 3 union elements], type[Any], /) -> None)` on TypedDict `CoreMetadata`: value of type `dict[object, object]`- pydantic/fields.py:949:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`+ pydantic/fields.py:949:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`- pydantic/fields.py:989:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`+ pydantic/fields.py:989:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`- pydantic/fields.py:1032:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`+ pydantic/fields.py:1032:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`- pydantic/fields.py:1072:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`+ pydantic/fields.py:1072:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`- pydantic/fields.py:1115:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`+ pydantic/fields.py:1115:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`- pydantic/fields.py:1154:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`+ pydantic/fields.py:1154:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`- pydantic/fields.py:1194:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`+ pydantic/fields.py:1194:5: error[invalid-parameter-default] Default value of type `PydanticUndefinedType` is not assignable to annotated parameter type `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`- pydantic/fields.py:1573:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Divergent] | ((dict[str, Divergent], /) -> None) | None`, found `Top[dict[Unknown, Unknown]] | (((dict[str, Divergent], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None`+ pydantic/fields.py:1573:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, int | float | str | ... omitted 3 union elements] | ((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) | None`, found `Top[dict[Unknown, Unknown]] | (((dict[str, int | float | str | ... omitted 3 union elements], /) -> None) & ~Top[dict[Unknown, Unknown]]) | None`
vision (https://github.com/pytorch/vision)
- test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `InterpolationMode | int`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `InterpolationMode | int`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1543:49: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1597:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1597:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1597:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1597:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1597:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1597:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `InterpolationMode | int`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1684:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `InterpolationMode | int`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Number | Sequence[Unknown]`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int | float] | None`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`- test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `InterpolationMode | int`, found `Unknown | tuple[int, int, int, int] | int | tuple[int | float, int | float]`+ test/test_transforms_v2.py:1739:45: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `InterpolationMode | int`, found `Unknown | int | tuple[int | float, int | float] | tuple[int, int, int, int]`
artigraph (https://github.com/artigraph/artigraph)
- tests/arti/types/test_types.py:100:51: error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `frozenset[float | Unknown | int] | list[Unknown | int | float] | tuple[float | Unknown | int, ...]`+ tests/arti/types/test_types.py:100:51: error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `frozenset[float | Unknown | int] | list[int | Unknown | float] | tuple[float | Unknown | int, ...]`
cloud-init (https://github.com/canonical/cloud-init)
- tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`+ tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`- tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`+ tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`
dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/debugging/_redaction.py:16:5: error[unsupported-operator] Operator `|` is not supported between objects of type `frozenset[Unknown | str]` and `Unknown | EnvVariable[set[Unknown]]`+ ddtrace/debugging/_redaction.py:16:5: error[unsupported-operator] Operator `|` is not supported between objects of type `frozenset[str | Unknown]` and `Unknown | EnvVariable[set[Unknown]]`- scripts/freshvenvs.py:343:69: error[invalid-argument-type] Argument to function `_versions_fully_cover_bounds` is incorrect: Expected `list[str]`, found `list[Unknown | Version] & ~AlwaysFalsy`+ scripts/freshvenvs.py:343:69: error[invalid-argument-type] Argument to function `_versions_fully_cover_bounds` is incorrect: Expected `list[str]`, found `list[Version | Unknown] & ~AlwaysFalsy`- tests/tracer/test_span.py:193:29: error[invalid-argument-type] Argument to bound method `set_metric` is incorrect: Expected `int | float`, found `Span | Unknown | None | ... omitted 6 union elements`+ tests/tracer/test_span.py:193:29: error[invalid-argument-type] Argument to bound method `set_metric` is incorrect: Expected `int | float`, found `int | Unknown | None | ... omitted 6 union elements`
ibis (https://github.com/ibis-project/ibis)
- ibis/selectors.py:333:16: error[invalid-return-type] Return type does not match returned value: expected `frozenset[str]`, found `frozenset[str | Buffer | Unknown]`+ ibis/selectors.py:333:16: error[invalid-return-type] Return type does not match returned value: expected `frozenset[str]`, found `frozenset[Buffer | Unknown | str]`- ibis/selectors.py:428:13: error[invalid-assignment] Object of type `frozenset[str | Unknown]` is not assignable to `tuple[str | Column, ...]`+ ibis/selectors.py:428:13: error[invalid-assignment] Object of type `frozenset[Unknown | str]` is not assignable to `tuple[str | Column, ...]`
jax (https://github.com/google/jax)
- jax/_src/pallas/hlo_interpreter.py:433:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | DynamicGridDim | Unknown`+ jax/_src/pallas/hlo_interpreter.py:433:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | Unknown | DynamicGridDim`- jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1900:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | DynamicGridDim | Unknown`+ jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:1900:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | Unknown | DynamicGridDim`- jax/_src/pallas/pallas_call.py:864:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | DynamicGridDim | Unknown`+ jax/_src/pallas/pallas_call.py:864:37: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `int | Unknown | DynamicGridDim`- jax/collect_profile.py:110:17: error[unresolved-attribute] Attribute `glob` is not defined on `PathLike[str]`, `int`, `str`, `bytes`, `PathLike[bytes]` in union `PathLike[str] | Unknown | int | ... omitted 3 union elements`+ jax/collect_profile.py:110:17: error[unresolved-attribute] Attribute `glob` is not defined on `PathLike[str]`, `int`, `str`, `bytes`, `PathLike[bytes]` in union `Unknown | PathLike[str] | int | ... omitted 3 union elements`- jax/collect_profile.py:113:22: error[unsupported-operator] Operator `/` is not supported between objects of type `PathLike[str] | Unknown | int | ... omitted 3 union elements` and `Literal["remote.trace.json.gz"]`+ jax/collect_profile.py:113:22: error[unsupported-operator] Operator `/` is not supported between objects of type `Unknown | PathLike[str] | int | ... omitted 3 union elements` and `Literal["remote.trace.json.gz"]`
rotki (https://github.com/rotki/rotki)
- rotkehlchen/tests/unit/test_makerdao.py:170:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | Unknown | dict[Unknown | str, Unknown | Balance]]`+ rotkehlchen/tests/unit/test_makerdao.py:170:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | dict[Unknown | str, Unknown | Balance] | Unknown]`- rotkehlchen/tests/unit/test_makerdao.py:171:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | Unknown | dict[Unknown | str, Unknown | Balance]]`+ rotkehlchen/tests/unit/test_makerdao.py:171:9: error[invalid-argument-type] Argument is incorrect: Expected `defaultdict[Asset, defaultdict[str, Balance]]`, found `defaultdict[Asset | Unknown, defaultdict[str, Balance] | Balance | dict[Unknown | str, Unknown | Balance] | Unknown]`
sympy (https://github.com/sympy/sympy)
- sympy/geometry/tests/test_util.py:128:55: error[invalid-argument-type] Argument to function `subsets` is incorrect: Expected `Sequence[Unknown]`, found `set[Point2D | Unknown]`+ sympy/geometry/tests/test_util.py:128:55: error[invalid-argument-type] Argument to function `subsets` is incorrect: Expected `Sequence[Unknown]`, found `set[Unknown | Point2D]`- sympy/integrals/prde.py:89:11: error[unresolved-attribute] Attribute `as_poly` is not defined on `int` in union `int | Unknown`+ sympy/integrals/prde.py:89:11: error[unresolved-attribute] Attribute `as_poly` is not defined on `int` in union `Unknown | int`- sympy/integrals/prde.py:89:61: error[unresolved-attribute] Attribute `as_poly` is not defined on `int` in union `int | Unknown`+ sympy/integrals/prde.py:89:61: error[unresolved-attribute] Attribute `as_poly` is not defined on `int` in union `Unknown | int`- sympy/integrals/prde.py:90:10: error[unresolved-attribute] Attribute `as_poly` is not defined on `int` in union `int | Unknown`+ sympy/integrals/prde.py:90:10: error[unresolved-attribute] Attribute `as_poly` is not defined on `int` in union `Unknown | int`- sympy/matrices/expressions/hadamard.py:81:22: error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `int | Any | Basic | float | complex`+ sympy/matrices/expressions/hadamard.py:81:22: error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Basic | int | float | complex | Any`- sympy/matrices/expressions/kronecker.py:109:16: error[unresolved-attribute] Attribute `is_Identity` is not defined on `int`, `Basic`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/matrices/expressions/kronecker.py:109:16: error[unresolved-attribute] Attribute `is_Identity` is not defined on `Basic`, `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/matrices/expressions/kronecker.py:110:33: error[unresolved-attribute] Attribute `rows` is not defined on `int`, `Basic`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/matrices/expressions/kronecker.py:110:33: error[unresolved-attribute] Attribute `rows` is not defined on `Basic`, `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/matrices/expressions/matadd.py:60:22: error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Unknown | int | Basic | float | complex`+ sympy/matrices/expressions/matadd.py:60:22: error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Unknown | Basic | int | float | complex`- sympy/parsing/mathematica.py:692:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Never]`, found `Unknown | list[Unknown | str]`- sympy/polys/fields.py:101:24: error[unresolved-attribute] Attribute `as_numer_denom` is not defined on `int`, `Basic`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/polys/fields.py:101:24: error[unresolved-attribute] Attribute `as_numer_denom` is not defined on `Basic`, `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:472:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:472:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:474:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:474:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:476:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:476:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:478:63: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:478:63: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:480:63: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:480:63: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:482:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:482:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:492:62: error[invalid-argument-type] Argument to bound method `frac_field` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:492:62: error[invalid-argument-type] Argument to bound method `frac_field` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/polys/polyoptions.py:494:62: error[invalid-argument-type] Argument to bound method `frac_field` is incorrect: Expected `str | Expr`, found `int | Any | Basic | float | complex`+ sympy/polys/polyoptions.py:494:62: error[invalid-argument-type] Argument to bound method `frac_field` is incorrect: Expected `str | Expr`, found `Basic | int | float | complex | Any`- sympy/series/order.py:153:20: error[unresolved-attribute] Attribute `is_symbol` is not defined on `int`, `float`, `complex` in union `Unknown | int | Basic | float | complex`+ sympy/series/order.py:153: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:188:28: error[unsupported-operator] Operator `/` is not supported between objects of type `Literal[1]` and `Unknown | int | Basic | float | complex`+ sympy/series/order.py:188:28: error[unsupported-operator] Operator `/` is not supported between objects of type `Literal[1]` and `Unknown | Basic | int | float | complex`- sympy/series/order.py:192:29: error[unsupported-operator] Operator `/` is not supported between objects of type `Literal[-1]` and `Unknown | int | Basic | float | complex`+ sympy/series/order.py:192:29: error[unsupported-operator] Operator `/` is not supported between objects of type `Literal[-1]` and `Unknown | Basic | int | float | complex`- sympy/series/order.py:269:52: error[invalid-argument-type] Argument to bound method `as_independent` is incorrect: Expected `Basic | type[Basic]`, found `int | Any | Basic | float | complex`+ sympy/series/order.py:269:52: error[invalid-argument-type] Argument to bound method `as_independent` is incorrect: Expected `Basic | type[Basic]`, found `Basic | int | float | complex | Any`- sympy/series/order.py:269:52: error[invalid-argument-type] Argument to bound method `as_independent` is incorrect: Expected `Basic | type[Basic]`, found `int | Any | Basic | float | complex`+ sympy/series/order.py:269:52: error[invalid-argument-type] Argument to bound method `as_independent` is incorrect: Expected `Basic | type[Basic]`, found `Basic | int | float | complex | Any`- sympy/series/order.py:269:52: error[invalid-argument-type] Argument to bound method `as_independent` is incorrect: Expected `Basic | type[Basic]`, found `int | Any | Basic | float | complex`+ sympy/series/order.py:269:52: error[invalid-argument-type] Argument to bound method `as_independent` is incorrect: Expected `Basic | type[Basic]`, found `Basic | int | float | complex | Any`- sympy/series/order.py:287:45: error[unsupported-operator] Unary operator `-` is not supported for object of type `int | Any | Basic | float | complex`+ sympy/series/order.py:287:45: error[unsupported-operator] Unary operator `-` is not supported for object of type `Basic | int | float | complex | Any`- sympy/series/order.py:288:48: error[unsupported-operator] Operator `**` is not supported between objects of type `int | Any | Basic | float | complex` and `Basic`+ sympy/series/order.py:288:48: error[unsupported-operator] Operator `**` is not supported between objects of type `Basic | int | float | complex | Any` and `Basic`- sympy/series/order.py:291:49: error[unsupported-operator] Unary operator `-` is not supported for object of type `int | Any | Basic | float | complex`+ sympy/series/order.py:291:49: error[unsupported-operator] Unary operator `-` is not supported for object of type `Basic | int | float | complex | Any`- sympy/series/order.py:297:53: error[unsupported-operator] Unary operator `-` is not supported for object of type `int | Any | Basic | float | complex`+ sympy/series/order.py:297:53: error[unsupported-operator] Unary operator `-` is not supported for object of type `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1046:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1046:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1047:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1047:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1048:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1048:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1087:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1087:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1088:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1088:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1089:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1089:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1175:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1175:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1176:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1176:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1177:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1177:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1178:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1178:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1179:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1179:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1213:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1213:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1214:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1214:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1215:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1215:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1216:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1216:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1217:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1217:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1265:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1265:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1266:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1266:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1267:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1267:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1268:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1268:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1269:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1269:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1313:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1313:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1314:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1314:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1315:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1315:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1316:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1316:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Basic | int | float | complex | Any`- sympy/simplify/hyperexpand.py:1317:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `int | Any | Basic | float | complex`+ sympy/simplify/hyperexpand.py:1317:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Basic | int | float | complex | Any`- sympy/simplify/simplify.py:357:10: error[unsupported-operator] Operator `/` is not supported between two objects of type `int | Any | Basic | float | complex`+ sympy/simplify/simplify.py:357:10: error[unsupported-operator] Operator `/` is not supported between two objects of type `Basic | int | float | complex | Any`- sympy/solvers/recurr.py:417:9: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/solvers/recurr.py:417:9: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/solvers/recurr.py:417:9: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Any | Basic`+ sympy/solvers/recurr.py:417:9: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Basic | Any`- sympy/solvers/recurr.py:421:24: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/solvers/recurr.py:421:24: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/solvers/recurr.py:436:24: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/solvers/recurr.py:436:24: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/solvers/recurr.py:589:23: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/solvers/recurr.py:589:23: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/solvers/solvers.py:3176:26: error[unresolved-attribute] Attribute `as_independent` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3176:26: error[unresolved-attribute] Attribute `as_independent` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3200:24: error[unresolved-attribute] Attribute `as_independent` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3200:24: error[unresolved-attribute] Attribute `as_independent` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3214:21: error[unresolved-attribute] Attribute `is_polynomial` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3214:21: error[unresolved-attribute] Attribute `is_polynomial` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3262:38: error[unsupported-operator] Operator `**` is not supported between objects of type `Basic | Divergent` and `Literal[2]`+ sympy/solvers/solvers.py:3262:38: error[unsupported-operator] Operator `**` is not supported between objects of type `Basic | Divergent | Divergent` and `Literal[2]`- sympy/solvers/solvers.py:3262:45: error[unsupported-operator] Operator `**` is not supported between objects of type `Basic | Divergent` and `Literal[2]`+ sympy/solvers/solvers.py:3262:45: error[unsupported-operator] Operator `**` is not supported between objects of type `Basic | Divergent | Divergent` and `Literal[2]`- sympy/solvers/solvers.py:3278:35: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3278:35: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3278:58: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3278:58: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3279:19: error[unsupported-operator] Operator `/` is not supported between objects of type `Literal[1]` and `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3279:19: error[unsupported-operator] Operator `/` is not supported between objects of type `Literal[1]` and `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3291:13: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3291:13: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3291:52: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3291:52: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3292:42: error[unresolved-attribute] Attribute `base` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3292:42: error[unresolved-attribute] Attribute `base` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3293:27: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3293:27: error[unresolved-attribute] Attribute `exp` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/solvers/solvers.py:3294:19: error[unresolved-attribute] Attribute `base` is not defined on `Basic` in union `Unknown | Divergent | Basic`+ sympy/solvers/solvers.py:3294:19: error[unresolved-attribute] Attribute `base` is not defined on `Basic` in union `Unknown | Divergent | Basic | Divergent`- sympy/stats/symbolic_probability.py:531:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Unknown | Basic`+ sympy/stats/symbolic_probability.py:531:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Basic | Unknown`- sympy/stats/symbolic_probability.py:532:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Unknown | Basic`+ sympy/stats/symbolic_probability.py:532:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Basic | Unknown`- sympy/tensor/indexed.py:161:79: error[unresolved-attribute] Attribute `is_number` is not defined on `int`, `float`, `complex` in union `int | Any | Basic | float | complex`+ sympy/tensor/indexed.py:161:79: error[unresolved-attribute] Attribute `is_number` is not defined on `int`, `float`, `complex` in union `Basic | int | float | complex | Any`- sympy/tensor/indexed.py:169:39: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `int | Any | Basic | float | complex`+ sympy/tensor/indexed.py:169:39: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `Basic | int | float | complex | Any`- sympy/tensor/indexed.py:650:12: error[unresolved-attribute] Attribute `is_Number` is not defined on `int`, `float`, `complex`, `None` in union `int | Any | Basic | ... omitted 3 union elements`+ sympy/tensor/indexed.py:650:12: error[unresolved-attribute] Attribute `is_Number` is not defined on `int`, `float`, `complex`, `None` in union `int | float | complex | ... omitted 3 union elements`- sympy/tensor/indexed.py:651:20: error[unresolved-attribute] Attribute `is_integer` is not defined on `int`, `complex`, `None` in union `int | Any | Basic | ... omitted 3 union elements`+ sympy/tensor/indexed.py:651:20: error[unresolved-attribute] Attribute `is_integer` is not defined on `int`, `complex`, `None` in union `int | float | complex | ... omitted 3 union elements`- sympy/tensor/indexed.py:655:16: error[unresolved-attribute] Attribute `is_integer` is not defined on `int`, `complex`, `None` in union `int | Any | Basic | ... omitted 3 union elements`+ sympy/tensor/indexed.py:655:16: error[unresolved-attribute] Attribute `is_integer` is not defined on `int`, `complex`, `None` in union `int | float | complex | ... omitted 3 union elements`- sympy/tensor/indexed.py:678:33: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `int | Any | Basic | ... omitted 3 union elements`+ sympy/tensor/indexed.py:678:33: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `int | float | complex | ... omitted 3 union elements`- Found 16135 diagnostics+ Found 16134 diagnostics
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/indexes/str/test_add.py:27:14: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[Unknown | str]` and `Literal[4]`+ tests/indexes/str/test_add.py:27:14: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[str | Unknown]` and `Literal[4]`- tests/indexes/str/test_add.py:28:23: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[Unknown | str]` and `Literal["right"]`+ tests/indexes/str/test_add.py:28:23: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[str | Unknown]` and `Literal["right"]`- tests/indexes/str/test_add.py:31:14: error[unsupported-operator] Operator `+` is not supported between objects of type `Literal[4]` and `Index[Unknown | str]`+ tests/indexes/str/test_add.py:31:14: error[unsupported-operator] Operator `+` is not supported between objects of type `Literal[4]` and `Index[str | Unknown]`- tests/indexes/str/test_add.py:42:14: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[Unknown | str]` and `list[Unknown | int]`+ tests/indexes/str/test_add.py:42:14: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[str | Unknown]` and `list[Unknown | int]`- tests/indexes/str/test_add.py:43:23: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[Unknown | str]` and `list[Unknown | str]`+ tests/indexes/str/test_add.py:43:23: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[str | Unknown]` and `list[Unknown | str]`- tests/indexes/str/test_add.py:44:23: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[Unknown | str]` and `tuple[Unknown | str, ...]`+ tests/indexes/str/test_add.py:44:23: error[unsupported-operator] Operator `+` is not supported between objects of type `Index[str | Unknown]` and `tuple[Unknown | str, ...]`- tests/indexes/str/test_add.py:47:14: error[unsupported-operator] Operator `+` is not supported between objects of type `list[Unknown | int]` and `Index[Unknown | str]`+ tests/indexes/str/test_add.py:47:14: error[unsupported-operator] Operator `+` is not supported between objects of type `list[Unknown | int]` and `Index[str | Unknown]`- tests/indexes/str/test_add.py:48:23: error[unsupported-operator] Operator `+` is not supported between objects of type `list[Unknown | str]` and `Index[Unknown | str]`+ tests/indexes/str/test_add.py:48:23: error[unsupported-operator] Operator `+` is not supported between objects of type `list[Unknown | str]` and `Index[str | Unknown]`- tests/indexes/str/test_add.py:49:11: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/indexes/str/test_add.py:49:11: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/indexes/str/test_mul.py:31:18: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/indexes/str/test_mul.py:31:18: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/indexes/test_indexes.py:304:9: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/indexes/test_indexes.py:304:9: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/indexes/test_indexes.py:311:9: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/indexes/test_indexes.py:311:9: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/indexes/test_indexes.py:1027:11: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/indexes/test_indexes.py:1027:11: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/indexes/test_indexes.py:1028:11: error[type-assertion-failure] Type `Unknown | str` does not match asserted type `str`+ tests/indexes/test_indexes.py:1028:11: error[type-assertion-failure] Type `str | Unknown` does not match asserted type `str`- tests/indexes/test_indexes.py:1029:11: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/indexes/test_indexes.py:1029:11: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/indexes/test_indexes.py:1335:9: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/indexes/test_indexes.py:1335:9: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/indexes/test_indexes.py:1532:11: error[type-assertion-failure] Type `Series[Unknown | str]` does not match asserted type `Series[str]`+ tests/indexes/test_indexes.py:1532:11: error[type-assertion-failure] Type `Series[str | Unknown]` does not match asserted type `Series[str]`+ tests/series/test_series.py:2439:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `Series[Timestamp]`- tests/test_string_accessors.py:29:11: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`+ tests/test_string_accessors.py:29:11: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`- tests/test_string_accessors.py:30:11: error[type-assertion-failure] Type `Index[bytes | Unknown]` does not match asserted type `Index[bytes]`+ tests/test_string_accessors.py:30:11: error[type-assertion-failure] Type `Index[Unknown | bytes]` does not match asserted type `Index[bytes]`- Found 4691 diagnostics+ Found 4692 diagnostics
scipy (https://github.com/scipy/scipy)
- subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`+ subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`- subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:76: error[unresolved-attribute] Attribute `dtype` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`+ subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:76: error[unresolved-attribute] Attribute `dtype` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`- subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:117:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`+ subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:117:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Probably related: astral-sh/ty#2808
I noticed that #22794 made isort run about 30x slower than it was before.
https://548dfc80.ty-ecosystem-ext.pages.dev/timing
isort has very large loop blocks in its codebase (e.g. https://github.com/PyCQA/isort/blob/b5f06a7b1d53b7b561f00f40f814ef1698864bac/isort/core.py#L32).
We need to implement performance optimization solutions for these kinds of large loops.
In this PR, I implement one of the slowdown mitigation measures I came up with. The actual inference of the loop variable is done in two places:
infer_loop_header_definitionandplace_from_bindings_impl(theLoopHeaderbranch). Reachability analysis is performed independently here, but this calculation is very expensive and should be cached. Therefore, I add a tracked functionloop_header_reachability.This change has resulted in a 12-19% performance improvement for isort locally.
See also: #23521
cc: @oconnor663
Test Plan
N/A