Skip to content

Comments

[ty] filter out pre-loop bindings from loop headers#23536

Open
oconnor663 wants to merge 1 commit intomainfrom
jack/loop_header_bindings_in_loop_only
Open

[ty] filter out pre-loop bindings from loop headers#23536
oconnor663 wants to merge 1 commit intomainfrom
jack/loop_header_bindings_in_loop_only

Conversation

@oconnor663
Copy link
Contributor

@oconnor663 oconnor663 commented Feb 24, 2026

Reading through @mtshiba's #23520 (specifically if def != definition here) made it clear that the way I included pre-loop bindings in loop headers in #22794 is kind of gross. Apart from being fully redundant (loop headers don't shadow pre-existing bindings), it also means that loop headers tracks themselves, which presumably creates pointless cycles that need to be resolved. Since definition IDs are issued in source code order, it's relatively easy to filter out all the definitions that existed before the loop began, including the loop headers. Anecdotally this seems to give a ~10% speedup in isort, which is the repo that motivated #23520. I'll be curious to see if the ecosystem report shows changed diagnostics, but I'm not sure it will.

Before landing this:

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 24, 2026

Typing conformance results

No changes detected ✅

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 24, 2026

mypy_primer results

Changes were detected when running on open source projects
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`

alerta (https://github.com/alerta/alerta)
- alerta/utils/api.py:123:48: error[invalid-assignment] Object of type `Unknown | None | Any | (tuple[Divergent, Divergent, Divergent, Divergent] & Alert) | (tuple[Divergent, str | Unknown, str | Unknown, int | Unknown] & Alert)` is not assignable to `Alert`
- alerta/utils/api.py:125:17: error[invalid-assignment] Too many values to unpack: Expected 3
- Found 627 diagnostics
+ Found 625 diagnostics

pylint (https://github.com/pycqa/pylint)
- pylint/checkers/refactoring/implicit_booleaness_checker.py:219:24: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:219:24: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:219:62: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:219:62: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:222:27: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | (Unknown & ~None)`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:222:27: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `(Unknown & ~None) | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:236:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:236:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`
- pylint/checkers/refactoring/implicit_booleaness_checker.py:239:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `str | Unknown`
+ pylint/checkers/refactoring/implicit_booleaness_checker.py:239:29: error[unresolved-attribute] Attribute `as_string` is not defined on `str` in union `Unknown | str`

PyGithub (https://github.com/PyGithub/PyGithub)
- github/Requester.py:899:57: error[invalid-argument-type] Argument to bound method `__hostnameHasDomain` is incorrect: Expected `str | list[str]`, found `Unknown | list[Unknown | str] | list[None | Unknown | str]`
+ github/Requester.py:899:57: error[invalid-argument-type] Argument to bound method `__hostnameHasDomain` is incorrect: Expected `str | list[str]`, found `Unknown | list[Unknown | str] | list[str | Unknown | None]`

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[int | Unknown | 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[Unknown | int | float] | list[int | float | Unknown] | tuple[Unknown | int | float, ...]`

vision (https://github.com/pytorch/vision)
- test/test_transforms_v2.py:1551: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:1551: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:1551: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:1551: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:1551: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:1551: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:1551: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:1551: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:1551: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:1551: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:1605: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:1605: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:1605: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:1605: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:1605: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:1605: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:1692: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:1692: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:1692: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:1692: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:1692: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:1692: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:1692: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:1692: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:1747: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:1747: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:1747: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:1747: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:1747: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:1747: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:1747: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:1747: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]`

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`

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 `Unknown | str | None`
+ mesonbuild/dependencies/cuda.py:137:76: error[invalid-argument-type] Argument to function `version_compare_many` is incorrect: Expected `str`, found `str | None | Unknown`

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/deployments/runner.py:1017:70: error[unresolved-attribute] Attribute `__name__` is not defined on `((...) -> Any) & ((*args: object, **kwargs: object) -> object)` in union `Unknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))`
+ src/prefect/deployments/runner.py:1017:70: error[unresolved-attribute] Attribute `__name__` is not defined on `(...) -> Any` in union `Unknown | ((...) -> Any)`
+ src/prefect/flow_engine.py:1004:32: error[invalid-await] `Unknown | R@FlowRunEngine | Coroutine[Any, Any, R@FlowRunEngine]` is not awaitable
+ src/prefect/flow_engine.py:1610:24: error[invalid-await] `Unknown | R@AsyncFlowRunEngine | Coroutine[Any, Any, R@AsyncFlowRunEngine]` is not awaitable
- src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
+ src/prefect/flows.py:286:34: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
- src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `((**P@Flow) -> R@Flow) & ((*args: object, **kwargs: object) -> object)` has no attribute `__name__`
+ src/prefect/flows.py:404:68: error[unresolved-attribute] Object of type `(**P@Flow) -> R@Flow` has no attribute `__name__`
- Found 5926 diagnostics
+ Found 5928 diagnostics

manticore (https://github.com/trailofbits/manticore)
- manticore/core/smtlib/visitors.py:641:58: error[unsupported-operator] Operator `-` is not supported between objects of type `None | Unknown` and `None | Unknown`
+ manticore/core/smtlib/visitors.py:641:58: error[unsupported-operator] Operator `-` is not supported between two objects of type `None | Unknown`

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 `int | float | complex | ... 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 `str | Unknown | None | ... omitted 6 union elements`

sympy (https://github.com/sympy/sympy)
- 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:11: 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:89:61: 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/integrals/prde.py:90:10: error[unresolved-attribute] Attribute `as_poly` is not defined on `int` in union `int | Unknown`
- sympy/matrices/expressions/hadamard.py:81:22: error[invalid-argument-type] Argument to function `validate_matadd_integer` is incorrect: Expected `MatrixExpr`, found `Any | Basic | int | float | complex`
+ 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/kronecker.py:109:16: error[unresolved-attribute] Attribute `is_Identity` is not defined on `Basic`, `int`, `float`, `complex` in union `Any | Basic | int | float | complex`
+ 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:110:33: error[unresolved-attribute] Attribute `rows` is not defined on `Basic`, `int`, `float`, `complex` in union `Any | Basic | int | float | complex`
+ 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/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/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/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 `Basic`, `int`, `float`, `complex` in union `Any | Basic | int | float | complex`
+ 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/polyoptions.py:472:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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:474:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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:476:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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:478:63: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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:480:63: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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:482:61: error[invalid-argument-type] Argument to bound method `poly_ring` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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:492:62: error[invalid-argument-type] Argument to bound method `frac_field` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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:494:62: error[invalid-argument-type] Argument to bound method `frac_field` is incorrect: Expected `str | Expr`, found `Any | Basic | int | float | complex`
+ 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/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: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: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: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: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: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:269:52: error[invalid-argument-type] Argument to bound method `as_independent` is incorrect: Expected `Basic | type[Basic]`, found `Any | 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 `Any | 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 `Any | 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:287:45: error[unsupported-operator] Unary operator `-` is not supported for object of type `Any | Basic | int | float | complex`
+ 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:288:48: error[unsupported-operator] Operator `**` is not supported between objects of type `Any | Basic | int | float | complex` and `Basic`
+ 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:291:49: error[unsupported-operator] Unary operator `-` is not supported for object of type `Any | Basic | int | float | complex`
+ 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:297:53: error[unsupported-operator] Unary operator `-` is not supported for object of type `Any | Basic | int | float | complex`
+ sympy/series/order.py:297:53: error[unsupported-operator] Unary operator `-` is not supported for object of type `int | Any | Basic | float | complex`
- sympy/simplify/cse_main.py:299:23: error[not-iterable] Object of type `Unknown | Sized` may not be iterable
+ sympy/simplify/cse_main.py:299:23: error[not-iterable] Object of type `Sized | Unknown` may not be iterable
- sympy/simplify/cse_main.py:305:16: error[unsupported-operator] Operator `in` is not supported between objects of type `Unknown` and `Unknown | Sized`
+ sympy/simplify/cse_main.py:305:16: error[unsupported-operator] Operator `in` is not supported between objects of type `Unknown` and `Sized | Unknown`
- sympy/simplify/hyperexpand.py:1046:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1047:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1048:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Any | Basic | int | float | complex`
+ 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:1087:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1088:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1089:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Any | Basic | int | float | complex`
+ 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:1175:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1176:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1177:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1178:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1179:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Any | Basic | int | float | complex`
+ 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:1213:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1214:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1215:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1216:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1217:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Any | Basic | int | float | complex`
+ 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:1265:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1266:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1267:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1268:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1269:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Any | Basic | int | float | complex`
+ 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:1313:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1314:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1315:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1316:19: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[Unknown]`, found `Any | Basic | int | float | complex`
+ 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:1317:21: error[invalid-argument-type] Argument to bound method `pop` is incorrect: Expected `SupportsIndex`, found `Any | Basic | int | float | complex`
+ 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/simplify.py:357:10: error[unsupported-operator] Operator `/` is not supported between two objects of type `Any | Basic | int | float | complex`
+ sympy/simplify/simplify.py:357:10: error[unsupported-operator] Operator `/` is not supported between two objects of type `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 `Any | Basic | int | float | complex`
+ 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:421:24: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Any | Basic | int | float | complex`
+ 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:436:24: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Any | Basic | int | float | complex`
+ 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:589:23: error[unresolved-attribute] Attribute `subs` is not defined on `int`, `float`, `complex` in union `Any | Basic | int | float | complex`
+ 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/tests/test_pde.py:108:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:108:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:129:22: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:129:22: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:137:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:137:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:163:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:163:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:201:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:201:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- sympy/solvers/tests/test_pde.py:215:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(str | Unknown, /) -> Unknown`, found `<class 'Function'>`
+ sympy/solvers/tests/test_pde.py:215:16: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `(Unknown | str, /) -> Unknown`, found `<class 'Function'>`
- 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:531: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/stats/symbolic_probability.py:532:55: error[unresolved-attribute] Attribute `expand` is not defined on `Basic` in union `Unknown | Basic`
- sympy/tensor/indexed.py:161:79: error[unresolved-attribute] Attribute `is_number` is not defined on `int`, `float`, `complex` in union `Any | Basic | int | float | complex`
+ 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:169:39: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `Any | Basic | int | float | complex`
+ 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:650:12: error[unresolved-attribute] Attribute `is_Number` is not defined on `int`, `float`, `complex`, `None` in union `Any | Basic | int | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:650:12: error[unresolved-attribute] Attribute `is_Number` is not defined on `None`, `int`, `float`, `complex` in union `None | 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 `Any | Basic | int | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:651:20: error[unresolved-attribute] Attribute `is_integer` is not defined on `None`, `int`, `complex` in union `None | 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 `Any | Basic | int | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:655:16: error[unresolved-attribute] Attribute `is_integer` is not defined on `None`, `int`, `complex` in union `None | 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 `Any | Basic | int | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:678:33: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `None | Any | Basic | ... omitted 3 union elements`
- Found 16143 diagnostics
+ Found 16144 diagnostics

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/datasets/_lfw.py:469:60: error[invalid-argument-type] Argument to class `str` is incorrect: Expected `bytes | bytearray`, found `str | Unknown`
+ sklearn/datasets/_lfw.py:469:60: error[invalid-argument-type] Argument to class `str` is incorrect: Expected `bytes | bytearray`, found `Unknown | str`

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 | dict[Unknown | str, Unknown | Balance] | Unknown]`
+ 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: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]`
+ 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]]`

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[str | Unknown]` and `Literal[4]`
+ 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: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: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: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: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: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: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: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: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: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: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: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: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: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: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:49:11: error[type-assertion-failure] Type `Index[str | Unknown]` does not match asserted type `Index[str]`
+ 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_mul.py:31:18: 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/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:304: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:311:9: 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:1027:11: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[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:1028:11: error[type-assertion-failure] Type `Unknown | str` does not match asserted type `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:1029:11: 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:1335:9: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`
- tests/indexes/test_indexes.py:1532:11: error[type-assertion-failure] Type `Series[str | Unknown]` does not match asserted type `Series[str]`
+ tests/indexes/test_indexes.py:1532:11: error[type-assertion-failure] Type `Series[Unknown | str]` does not match asserted type `Series[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:29:11: error[type-assertion-failure] Type `Index[Unknown | str]` does not match asserted type `Index[str]`

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 24, 2026

Memory usage report

Summary

Project Old New Diff Outcome
trio 121.20MB 121.18MB -0.02% (23.80kB) ⬇️
flake8 49.47MB 49.43MB -0.09% (44.33kB) ⬇️
sphinx 272.25MB 271.71MB -0.20% (554.02kB) ⬇️
prefect 714.44MB 713.30MB -0.16% (1.14MB) ⬇️

Significant changes

Click to expand detailed breakdown

trio

Name Old New Diff Outcome
get_loop_header 82.12kB 72.88kB -11.25% (9.24kB) ⬇️
infer_definition_types 7.61MB 7.60MB -0.06% (4.97kB) ⬇️
all_negative_narrowing_constraints_for_expression 148.77kB 145.46kB -2.23% (3.31kB) ⬇️
loop_header_reachability 144.16kB 141.46kB -1.87% (2.70kB) ⬇️
all_narrowing_constraints_for_expression 487.04kB 485.04kB -0.41% (2.00kB) ⬇️
semantic_index 33.39MB 33.39MB -0.01% (1.77kB) ⬇️
infer_expression_type_impl 1.49MB 1.48MB -0.06% (996.00B) ⬇️
is_redundant_with_impl::interned_arguments 567.96kB 568.91kB +0.17% (968.00B) ⬇️
is_redundant_with_impl 487.80kB 488.65kB +0.17% (864.00B) ⬇️
infer_expression_types_impl 7.20MB 7.20MB -0.01% (520.00B) ⬇️
infer_scope_types_impl 4.90MB 4.90MB +0.00% (180.00B) ⬇️
Type<'db>::member_lookup_with_policy_::interned_arguments 868.05kB 867.95kB -0.01% (104.00B) ⬇️
Type<'db>::member_lookup_with_policy_ 1.69MB 1.69MB -0.00% (64.00B) ⬇️
place_table 76.70kB 76.64kB -0.08% (60.00B) ⬇️
solutions_inner 38.25kB 38.19kB -0.15% (60.00B) ⬇️
... 1 more

flake8

Name Old New Diff Outcome
infer_expression_type_impl 170.85kB 160.50kB -6.06% (10.35kB) ⬇️
infer_definition_types 1.89MB 1.88MB -0.49% (9.46kB) ⬇️
infer_expression_types_impl 1.08MB 1.07MB -0.85% (9.43kB) ⬇️
loop_header_reachability 20.51kB 14.86kB -27.56% (5.65kB) ⬇️
all_negative_narrowing_constraints_for_expression 36.07kB 31.94kB -11.45% (4.13kB) ⬇️
all_narrowing_constraints_for_expression 66.19kB 62.29kB -5.90% (3.91kB) ⬇️
get_loop_header 16.17kB 13.96kB -13.67% (2.21kB) ⬇️
is_redundant_with_impl::interned_arguments 166.20kB 166.89kB +0.41% (704.00B) ⬇️
semantic_index 15.29MB 15.29MB -0.00% (384.00B) ⬇️
is_redundant_with_impl 158.98kB 159.35kB +0.24% (384.00B) ⬇️
UnionType 112.44kB 112.58kB +0.13% (144.00B) ⬇️
infer_scope_types_impl 1013.19kB 1013.18kB -0.00% (12.00B) ⬇️

sphinx

Name Old New Diff Outcome
infer_expression_type_impl 3.36MB 3.25MB -3.41% (117.38kB) ⬇️
infer_expression_types_impl 22.02MB 21.91MB -0.48% (108.84kB) ⬇️
infer_definition_types 24.40MB 24.30MB -0.41% (101.29kB) ⬇️
get_loop_header 401.29kB 330.71kB -17.59% (70.58kB) ⬇️
semantic_index 69.45MB 69.41MB -0.07% (47.34kB) ⬇️
loop_header_reachability 436.46kB 394.91kB -9.52% (41.56kB) ⬇️
all_narrowing_constraints_for_expression 1.79MB 1.76MB -1.53% (27.92kB) ⬇️
all_negative_narrowing_constraints_for_expression 823.16kB 807.64kB -1.89% (15.52kB) ⬇️
is_redundant_with_impl::interned_arguments 2.15MB 2.15MB -0.21% (4.64kB) ⬇️
StaticClassLiteral<'db>::try_mro_ 2.17MB 2.17MB -0.16% (3.50kB) ⬇️
is_redundant_with_impl 1.86MB 1.86MB -0.17% (3.33kB) ⬇️
infer_unpack_types 455.09kB 452.11kB -0.65% (2.98kB) ⬇️
IntersectionType 1.03MB 1.03MB -0.12% (1.27kB) ⬇️
Specialization 1.05MB 1.05MB -0.10% (1.09kB) ⬇️
Type<'db>::apply_specialization_ 1.75MB 1.75MB -0.06% (1.08kB) ⬇️
... 12 more

prefect

Name Old New Diff Outcome
infer_expression_type_impl 15.22MB 14.91MB -2.05% (319.06kB) ⬇️
infer_expression_types_impl 61.84MB 61.53MB -0.49% (311.08kB) ⬇️
infer_definition_types 87.90MB 87.73MB -0.19% (174.64kB) ⬇️
all_negative_narrowing_constraints_for_expression 2.35MB 2.24MB -4.80% (115.71kB) ⬇️
all_narrowing_constraints_for_expression 5.72MB 5.62MB -1.78% (104.37kB) ⬇️
get_loop_header 548.13kB 488.41kB -10.89% (59.72kB) ⬇️
loop_header_reachability 509.94kB 473.25kB -7.19% (36.69kB) ⬇️
semantic_index 191.96MB 191.94MB -0.01% (22.88kB) ⬇️
is_redundant_with_impl::interned_arguments 5.62MB 5.61MB -0.12% (7.05kB) ⬇️
infer_scope_types_impl 52.69MB 52.69MB -0.01% (5.29kB) ⬇️
UnionType 3.64MB 3.63MB -0.13% (4.95kB) ⬇️
is_redundant_with_impl 5.65MB 5.64MB -0.07% (3.98kB) ⬇️
infer_unpack_types 891.59kB 888.42kB -0.36% (3.17kB) ⬇️
Type<'db>::member_lookup_with_policy_::interned_arguments 5.37MB 5.37MB -0.02% (936.00B) ⬇️
Type<'db>::member_lookup_with_policy_ 15.23MB 15.23MB -0.01% (912.00B) ⬇️
... 5 more

@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 24, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-await 0 40 0
invalid-assignment 0 1 0
invalid-return-type 0 1 0
unsupported-operator 0 0 1
Total 0 42 1

Full report with detailed diff (timing results)

@carljm carljm closed this Feb 24, 2026
@carljm carljm reopened this Feb 24, 2026
@oconnor663 oconnor663 force-pushed the jack/loop_header_bindings_in_loop_only branch from eab1bb6 to 495557c Compare February 24, 2026 20:22
@oconnor663
Copy link
Contributor Author

Rebased and applied the cleanup described here.

@AlexWaygood AlexWaygood removed their request for review February 24, 2026 20:23
@sharkdp
Copy link
Contributor

sharkdp commented Feb 25, 2026

I think the two ecosystem changes are worth looking into.

It took me a while to distill this MRE out of alerta, so I'm posting it here in case it's useful. It produces one additional diagnostic on main that is not present on your branch:

class Alert: ...

def f(*args, **kwargs):
    pass

def some_condition(*args, **kwargs) -> bool:
    return False

def process_action(alert: Alert, action: str):
    updated = None
    while some_condition(alert):
        if some_condition(1):
            updated = f(alert, action)
        elif some_condition(2):
            updated = f(alert, action)

        if isinstance(updated, Alert):
            updated = updated, action, 1

        if isinstance(updated, tuple):
            if len(updated) == 3:
                alert, action, timeout = updated
            elif len(updated) == 2:
                alert, action = updated

It would be good to understand if that diagnostic should go away.

And if that example is not strange enough, the diagnostic change in manticore is even weirder:

- manticore/core/smtlib/visitors.py:641:58: error[unsupported-operator] Operator `-` is not supported between objects of type `None | Unknown` and `None | Unknown`
+ manticore/core/smtlib/visitors.py:641:58: error[unsupported-operator] Operator `-` is not supported between two objects of type `None | Unknown`

Copy link
Contributor

@sharkdp sharkdp left a comment

Choose a reason for hiding this comment

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

Thank you — the change sounds very plausible and the implementation looks good. I can certainly imagine that this solves some bugs as well. It might therefore be interesting to understand the ecosystem changes better. Maybe there is a useful regression test that we could add?

If those cases seem too exotic though, I'm definitely in favor of merging this, even without a deep analysis. This definitely seems more correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecosystem-analyzer ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants