Skip to content

[ty] Narrow type context during collection literal inference#23844

Merged
ibraheemdev merged 3 commits intomainfrom
ibraheem/narrow-collection-tcx
Mar 12, 2026
Merged

[ty] Narrow type context during collection literal inference#23844
ibraheemdev merged 3 commits intomainfrom
ibraheem/narrow-collection-tcx

Conversation

@ibraheemdev
Copy link
Member

Collection literals are effectively a special case of generic calls, so there's no reason we shouldn't be applying the same narrowing logic here.

Part of astral-sh/ty#3001.

@ibraheemdev ibraheemdev requested a review from carljm as a code owner March 9, 2026 19:13
@ibraheemdev ibraheemdev added the ty Multi-file analysis & type inference label Mar 9, 2026
@ibraheemdev ibraheemdev requested a review from dcreager as a code owner March 9, 2026 19:13
@ibraheemdev ibraheemdev changed the title Narrow type context during collection literal inference [ty] Narrow type context during collection literal inference Mar 9, 2026
@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 9, 2026

Typing conformance results

No changes detected ✅

Current numbers
The percentage of diagnostics emitted that were expected errors held steady at 85.29%. The percentage of expected errors that received a diagnostic held steady at 78.13%. The number of fully passing files held steady at 64/132.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 9, 2026

mypy_primer results

Changes were detected when running on open source projects
attrs (https://github.com/python-attrs/attrs)
- tests/test_converters.py:265:18: error[no-matching-overload] No overload of function `attrib` matches arguments
- tests/test_converters.py:289:17: error[no-matching-overload] No overload of function `attrib` matches arguments
- tests/test_setattr.py:124:18: error[no-matching-overload] No overload of function `attrib` matches arguments
- tests/test_setattr.py:448:17: error[no-matching-overload] No overload of function `field` matches arguments
- Found 671 diagnostics
+ Found 667 diagnostics

starlette (https://github.com/encode/starlette)
- tests/test_datastructures.py:365:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Mapping[str, str | UploadFile] | list[tuple[str, str | UploadFile]]`, found `list[tuple[str, str] | tuple[str, UploadFile]]`
- tests/test_datastructures.py:381:59: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Mapping[str, str | UploadFile] | list[tuple[str, str | UploadFile]]`, found `list[tuple[str, str]]`
- Found 197 diagnostics
+ Found 195 diagnostics

urllib3 (https://github.com/urllib3/urllib3)
- test/test_fields.py:62:37: error[invalid-argument-type] Argument to bound method `_render_parts` is incorrect: Expected `dict[str, str | bytes | None] | Sequence[tuple[str, str | bytes | None]]`, found `dict[str, str]`
- Found 277 diagnostics
+ Found 276 diagnostics

mitmproxy (https://github.com/mitmproxy/mitmproxy)
- test/mitmproxy/contentviews/test__view_multipart.py:12:45: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- test/mitmproxy/contentviews/test__view_zip.py:13:45: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- test/mitmproxy/proxy/layers/http/test_http1.py:177:13: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- test/mitmproxy/proxy/layers/http/test_http1.py:209:13: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- test/mitmproxy/proxy/layers/test_websocket.py:210:9: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- test/mitmproxy/test_http.py:130:68: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- test/mitmproxy/test_http.py:142:57: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- test/mitmproxy/tools/console/test_flowview.py:29:13: error[invalid-argument-type] Argument to bound method `make` is incorrect: Expected `Headers | dict[str | bytes, str | bytes] | Iterable[tuple[bytes, bytes]]`, found `dict[str, str]`
- Found 2140 diagnostics
+ Found 2132 diagnostics

pandera (https://github.com/pandera-dev/pandera)
- tests/pandas/test_decorators.py:384:15: error[invalid-argument-type] Argument to function `check_io` is incorrect: Expected `pandera.api.dataframe.container.DataFrameSchema[Unknown] | ComponentSchema[Unknown] | tuple[str | int | ((...) -> Unknown), pandera.api.dataframe.container.DataFrameSchema[Unknown] | ComponentSchema[Unknown]] | list[tuple[str | int | ((...) -> Unknown), pandera.api.dataframe.container.DataFrameSchema[Unknown] | ComponentSchema[Unknown]]] | None`, found `list[tuple[int, pandera.api.pandas.container.DataFrameSchema]]`
- tests/pandas/test_decorators.py:390:9: error[invalid-argument-type] Argument to function `check_io` is incorrect: Expected `pandera.api.dataframe.container.DataFrameSchema[Unknown] | ComponentSchema[Unknown] | tuple[str | int | ((...) -> Unknown), pandera.api.dataframe.container.DataFrameSchema[Unknown] | ComponentSchema[Unknown]] | list[tuple[str | int | ((...) -> Unknown), pandera.api.dataframe.container.DataFrameSchema[Unknown] | ComponentSchema[Unknown]]] | None`, found `list[tuple[int, pandera.api.pandas.container.DataFrameSchema] | tuple[str, pandera.api.pandas.container.DataFrameSchema] | tuple[(x) -> Unknown, pandera.api.pandas.container.DataFrameSchema]]`
- Found 1643 diagnostics
+ Found 1641 diagnostics

vision (https://github.com/pytorch/vision)
- gallery/transforms/plot_transforms_e2e.py:106:26: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float | Sequence[int | float] | None | dict[type | str, int | float | Sequence[int | float] | None]`, found `dict[<class 'Image'> | str, tuple[int, int, int] | int]`
- test/test_models.py:399:5: error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `dict[str, tuple[int, int, int, int]]` on object of type `dict[str, dict[str, tuple[int, int, int, int] | bool] | dict[str, int | float | tuple[int, int, int]] | dict[str, int | tuple[int, int, int]] | ... omitted 4 union elements]`
- test/test_prototype_transforms.py:317:42: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Sequence[int] | dict[type, Sequence[int] | None]`, found `dict[Unknown, tuple[int, int]]`
- test/test_transforms_v2.py:7313:38: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | float | Sequence[int | float] | None | dict[type | str, int | float | Sequence[int | float] | None]`, found `dict[str | <class 'Mask'>, tuple[int | float, int | float, int | float] | int]`
- Found 1418 diagnostics
+ Found 1414 diagnostics

cwltool (https://github.com/common-workflow-language/cwltool)
- cwltool/command_line_tool.py:881:25: error[invalid-assignment] Invalid subscript assignment with key of type `str` and value of type `list[int]` on object of type `dict[str, MutableSequence[str | int] | MutableMapping[str, None | int | str | ... omitted 3 union elements]]`
- Found 503 diagnostics
+ Found 502 diagnostics

cloud-init (https://github.com/canonical/cloud-init)
+ tests/unittests/sources/test_ec2.py:664:21: error[unresolved-attribute] Attribute `get` is not defined on `str` in union `str | dict[str, str] | dict[str, dict[str, dict[str, dict[str, str | dict[str, str]]]]] | dict[str, list[str]]`
+ tests/unittests/sources/test_ec2.py:665:31: error[unresolved-attribute] Attribute `get` is not defined on `str`, `list[str]` in union `str | dict[str, dict[str, dict[str, str | dict[str, str]]]] | list[str]`
- Found 1316 diagnostics
+ Found 1318 diagnostics

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/cli/deployment.py:817:65: error[invalid-argument-type] Argument to bound method `create_deployment_schedules` is incorrect: Expected `list[tuple[IntervalSchedule | CronSchedule | RRuleSchedule | NoSchedule, bool]] | list[DeploymentScheduleCreate]`, found `list[tuple[IntervalSchedule | CronSchedule | RRuleSchedule, bool]]`
- Found 5889 diagnostics
+ Found 5888 diagnostics

xarray (https://github.com/pydata/xarray)
- xarray/core/dataarray.py:473:9: error[invalid-assignment] Object of type `(Sequence[Sequence[Unknown] | Index[Any] | DataArray | Variable | ndarray[tuple[Any, ...], dtype[Any]]] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[dict[Unknown, Unknown]]) | dict[Hashable, Variable]` is not assignable to attribute `_coords` of type `dict[Any, Variable]`
+ xarray/core/dataarray.py:473:9: error[invalid-assignment] Object of type `(Sequence[Sequence[Unknown] | Index[Any] | DataArray | Variable | ndarray[tuple[Any, ...], dtype[Any]]] & Top[dict[Unknown, Unknown]]) | (Mapping[Unknown, Unknown] & Top[dict[Unknown, Unknown]]) | dict[Unknown, Variable]` is not assignable to attribute `_coords` of type `dict[Any, Variable]`

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
- src/scikit_build_core/build/wheel.py:99:20: error[no-matching-overload] No overload of bound method `__init__` matches arguments
- Found 58 diagnostics
+ Found 57 diagnostics

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- src/hydra_zen/_launch.py:413:45: error[invalid-argument-type] Argument to function `_process_dict_overrides` is incorrect: Expected `Mapping[str, None | int | float | ... omitted 4 union elements]`, found `Mapping[str, None | int | float | ... omitted 4 union elements] | (list[str] & Top[Mapping[Unknown, object]]) | (list[Unknown] & Top[Mapping[Unknown, object]])`
+ src/hydra_zen/_launch.py:413:45: error[invalid-argument-type] Argument to function `_process_dict_overrides` is incorrect: Expected `Mapping[str, None | int | float | ... omitted 4 union elements]`, found `Mapping[str, None | int | float | ... omitted 4 union elements] | (list[str] & Top[Mapping[Unknown, object]])`

egglog-python (https://github.com/egraphs-good/egglog-python)
+ python/egglog/declarations.py:666:83: error[invalid-assignment] Object of type `WeakValueDictionary[str | tuple[object, ...] | Unknown, Unknown]` is not assignable to `WeakValueDictionary[tuple[object, ...], CallDecl]`
- python/tests/test_high_level.py:792:29: error[invalid-argument-type] Argument to function `my_fn` is incorrect: Expected `Set[i64] | set[i64 | int]`, found `set[int]`
- python/tests/test_high_level.py:800:29: error[invalid-argument-type] Argument to function `my_fn` is incorrect: Expected `Map[i64, String] | dict[i64 | int, String | str]`, found `dict[int, str]`
- Found 1476 diagnostics
+ Found 1475 diagnostics

sympy (https://github.com/sympy/sympy)
- sympy/polys/tests/test_polytools.py:130:9: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], int]`
- sympy/polys/tests/test_polytools.py:132:9: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], int]`
- sympy/polys/tests/test_polytools.py:134:27: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int, int], int]`
- sympy/polys/tests/test_polytools.py:147:9: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], int]`
- sympy/polys/tests/test_polytools.py:149:9: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], int]`
- sympy/polys/tests/test_polytools.py:152:9: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], int]`
- sympy/polys/tests/test_polytools.py:154:9: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], int]`
- sympy/polys/tests/test_polytools.py:156:27: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], sin]`
- sympy/polys/tests/test_polytools.py:158:27: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int], Symbol]`
- sympy/polys/tests/test_polytools.py:160:27: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int, int], int]`
- sympy/polys/tests/test_polytools.py:162:27: error[invalid-argument-type] Argument to bound method `from_dict` is incorrect: Expected `dict[tuple[int, ...], Any] | dict[int, Any]`, found `dict[tuple[int, int], Symbol]`
- Found 16479 diagnostics
+ Found 16468 diagnostics

materialize (https://github.com/MaterializeInc/materialize)
- misc/python/materialize/cli/optbench.py:270:19: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- misc/python/materialize/cli/optbench.py:274:19: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- Found 542 diagnostics
+ Found 540 diagnostics

pandas (https://github.com/pandas-dev/pandas)
- pandas/io/formats/style_render.py:1414:25: error[invalid-assignment] Object of type `dict[Any, object]` is not assignable to `str | ((...) -> Unknown) | dict[Any, str | ((...) -> Unknown) | None] | None`
+ pandas/io/formats/style_render.py:1414:25: error[invalid-assignment] Object of type `dict[int, object]` is not assignable to `str | ((...) -> Unknown) | dict[Any, str | ((...) -> Unknown) | None] | None`
- pandas/io/formats/style_render.py:1715:25: error[invalid-assignment] Object of type `dict[Any, object]` is not assignable to `str | ((...) -> Unknown) | dict[Any, str | ((...) -> Unknown) | None] | None`
+ pandas/io/formats/style_render.py:1715:25: error[invalid-assignment] Object of type `dict[int, object]` is not assignable to `str | ((...) -> Unknown) | dict[Any, str | ((...) -> Unknown) | None] | None`
- pandas/tests/apply/test_frame_apply.py:915:23: error[invalid-argument-type] Argument to bound method `apply` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[(x) -> Unknown]`
- pandas/tests/apply/test_frame_apply.py:1652:24: error[invalid-argument-type] Argument to bound method `apply` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[str | ((x) -> Unknown)]`
- pandas/tests/apply/test_frame_transform.py:81:22: error[invalid-argument-type] Argument to bound method `transform` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[((x, a=1, c=0) -> Unknown) | ((x, b=2, c=0) -> Unknown)]`
- pandas/tests/apply/test_frame_transform.py:83:27: error[invalid-argument-type] Argument to bound method `transform` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[((x, a=1, c=0) -> Unknown) | ((x, b=2, c=0) -> Unknown)]`
- pandas/tests/apply/test_frame_transform.py:226:22: error[invalid-argument-type] Argument to bound method `transform` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[(x) -> Unknown]`
- pandas/tests/apply/test_series_apply.py:353:23: error[invalid-argument-type] Argument to bound method `transform` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[((x) -> Unknown) | ((_) -> Unknown)]`
- pandas/tests/apply/test_series_apply.py:470:22: error[invalid-argument-type] Argument to bound method `apply` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[str | ((x) -> Unknown)]`
- pandas/tests/apply/test_series_transform.py:59:21: error[invalid-argument-type] Argument to bound method `transform` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[((x, a=1, c=0) -> Unknown) | ((x, b=2, c=0) -> Unknown)]`
- pandas/tests/apply/test_series_transform.py:61:26: error[invalid-argument-type] Argument to bound method `transform` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[((x, a=1, c=0) -> Unknown) | ((x, b=2, c=0) -> Unknown)]`
- pandas/tests/frame/test_repr.py:447:31: error[invalid-argument-type] Argument to bound method `to_string` is incorrect: Expected `list[(...) -> Unknown] | tuple[(...) -> Unknown, ...] | Mapping[str | int, (...) -> Unknown] | None`, found `list[Overload[(*args: LiteralString, **kwargs: LiteralString) -> LiteralString, (*args: object, **kwargs: object) -> str]]`
- pandas/tests/io/excel/test_readers.py:567:18: error[no-matching-overload] No overload of function `read_excel` matches arguments
- pandas/tests/io/formats/test_to_html.py:107:20: error[invalid-argument-type] Argument to bound method `to_html` is incorrect: Expected `Sequence[str | int] | int | Mapping[Hashable, str | int] | None`, found `dict[str, str | int]`
- pandas/tests/io/formats/test_to_html.py:115:25: error[invalid-argument-type] Argument to bound method `to_html` is incorrect: Expected `Sequence[str | int] | int | Mapping[Hashable, str | int] | None`, found `dict[str, str | int]`
- pandas/tests/io/formats/test_to_string.py:58:31: error[invalid-argument-type] Argument to bound method `to_string` is incorrect: Expected `list[(...) -> Unknown] | tuple[(...) -> Unknown, ...] | Mapping[str | int, (...) -> Unknown] | None`, found `list[Overload[(*args: LiteralString, **kwargs: LiteralString) -> LiteralString, (*args: object, **kwargs: object) -> str]]`
- pandas/tests/io/xml/test_xml.py:1520:13: error[invalid-argument-type] Argument to function `read_xml` is incorrect: Expected `bool | list[Hashable] | list[list[Hashable]] | dict[Hashable, list[Hashable]] | None`, found `list[str]`
- pandas/tests/io/xml/test_xml_dtypes.py:323:47: error[invalid-argument-type] Argument to function `read_xml` is incorrect: Expected `bool | list[Hashable] | list[list[Hashable]] | dict[Hashable, list[Hashable]] | None`, found `list[str]`
- pandas/tests/io/xml/test_xml_dtypes.py:346:47: error[invalid-argument-type] Argument to function `read_xml` is incorrect: Expected `bool | list[Hashable] | list[list[Hashable]] | dict[Hashable, list[Hashable]] | None`, found `list[int]`
- pandas/tests/io/xml/test_xml_dtypes.py:428:45: error[invalid-argument-type] Argument to function `read_xml` is incorrect: Expected `bool | list[Hashable] | list[list[Hashable]] | dict[Hashable, list[Hashable]] | None`, found `list[str]`
- pandas/tests/reshape/test_pivot.py:1745:13: error[invalid-argument-type] Argument to function `pivot_table` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[str]`
- pandas/tests/reshape/test_pivot.py:1909:13: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[str]`
- pandas/tests/reshape/test_pivot.py:2097:55: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[str]`
- pandas/tests/reshape/test_pivot.py:2159:60: error[invalid-argument-type] Argument to function `pivot_table` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[str]`
- pandas/tests/reshape/test_pivot.py:2297:34: error[invalid-argument-type] Argument to function `pivot_table` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[(x) -> Unknown]`
- pandas/tests/reshape/test_pivot.py:2634:13: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((...) -> Unknown) | str | list[((...) -> Unknown) | str] | MutableMapping[Hashable, ((...) -> Unknown) | str | list[((...) -> Unknown) | str]]`, found `list[str]`
- pandas/tests/tseries/holiday/test_holiday.py:285:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BaseOffset | list[BaseOffset] | None`, found `list[BaseOffset | Unknown | None | list[BaseOffset]]`
+ pandas/tests/tseries/holiday/test_holiday.py:285:9: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BaseOffset | list[BaseOffset] | None`, found `list[Unknown | None | BaseOffset | list[BaseOffset]]`
- pandas/tests/tseries/holiday/test_holiday.py:293:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BaseOffset | list[BaseOffset] | None`, found `list[BaseOffset | Unknown | None | list[BaseOffset]]`
+ pandas/tests/tseries/holiday/test_holiday.py:293:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `BaseOffset | list[BaseOffset] | None`, found `list[Unknown | None | BaseOffset | list[BaseOffset]]`
- Found 4572 diagnostics
+ Found 4548 diagnostics

static-frame (https://github.com/static-frame/static-frame)
- static_frame/test/unit/test_bus.py:3781:35: error[invalid-argument-type] Argument to bound method `from_manifest` is incorrect: Expected `Mapping[Hashable, str | PathLike[Any]] | Iterable[str | PathLike[Any]]`, found `dict[int, str]`
- static_frame/test/unit/test_container_util.py:760:38: error[invalid-argument-type] Argument to function `get_col_dtype_factory` is incorrect: Expected `Iterable[str | dtype[Any] | type | None] | dtype[Any] | type | None | dict[Hashable, str | dtype[Any] | type | None]`, found `dict[int, dtype[Any]]`
- static_frame/test/unit/test_frame.py:995:36: error[invalid-argument-type] Argument to bound method `from_pandas` is incorrect: Expected `Iterable[str | dtype[Any] | type | None] | dtype[Any] | type | None | dict[Hashable, str | dtype[Any] | type | None]`, found `dict[int, <class 'bool'>]`
- static_frame/test/unit/test_frame.py:1007:36: error[invalid-argument-type] Argument to bound method `from_pandas` is incorrect: Expected `Iterable[str | dtype[Any] | type | None] | dtype[Any] | type | None | dict[Hashable, str | dtype[Any] | type | None]`, found `dict[int, <class 'bool'> | <class 'float'>]`
- static_frame/test/unit/test_frame.py:9845:13: error[invalid-argument-type] Argument to bound method `from_delimited` is incorrect: Expected `Iterable[str | dtype[Any] | type | None] | dtype[Any] | type | None | dict[Hashable, str | dtype[Any] | type | None]`, found `dict[int, <class 'bool'> | <class 'str'>]`
- static_frame/test/unit/test_store_manifest.py:153:28: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Mapping[Hashable, str | PathLike[Any]] | Iterable[str | PathLike[Any]]`, found `dict[int, str]`
- static_frame/test/unit/test_store_manifest.py:169:28: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Mapping[Hashable, str | PathLike[Any]] | Iterable[str | PathLike[Any]]`, found `dict[tuple[str, int], str]`
- static_frame/test/unit/test_store_manifest.py:189:28: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Mapping[Hashable, str | PathLike[Any]] | Iterable[str | PathLike[Any]]`, found `dict[date, str]`
- static_frame/test/unit/test_store_manifest.py:202:28: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Mapping[Hashable, str | PathLike[Any]] | Iterable[str | PathLike[Any]]`, found `dict[int, str]`
- static_frame/test/unit/test_type_blocks.py:3539:47: error[invalid-argument-type] Argument to function `get_col_dtype_factory` is incorrect: Expected `Iterable[str | dtype[Any] | type | None] | dtype[Any] | type | None | dict[Hashable, str | dtype[Any] | type | None]`, found `dict[int, <class 'str'>]`
- static_frame/test/unit/test_type_blocks.py:3557:13: error[invalid-argument-type] Argument to function `get_col_dtype_factory` is incorrect: Expected `Iterable[str | dtype[Any] | type | None] | dtype[Any] | type | None | dict[Hashable, str | dtype[Any] | type | None]`, found `dict[int, <class 'str'>]`
- Found 1823 diagnostics
+ Found 1812 diagnostics

jax (https://github.com/google/jax)
- jax/_src/numpy/lax_numpy.py:972:12: error[invalid-assignment] Object of type `list[Array]` is not assignable to `Array | ndarray[tuple[Any, ...], dtype[Any]] | numpy.bool[builtins.bool] | ... omitted 6 union elements`
- Found 2136 diagnostics
+ Found 2135 diagnostics

rotki (https://github.com/rotki/rotki)
- rotkehlchen/db/history_events.py:2464:100: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive
+ rotkehlchen/externalapis/etherscan_like.py:619:37: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `EvmTransaction`, found `EvmInternalTransaction | EvmTransaction`
- rotkehlchen/tests/unit/test_ethereum_inquirer.py:416:56: error[invalid-argument-type] Argument to bound method `update_entry` is incorrect: Expected `int | str | FVal | ... omitted 9 union elements`, found `dict[ChainID, tuple[EvmIndexer]]`
- rotkehlchen/tests/unit/test_evm_indexer_order.py:67:9: error[invalid-argument-type] Argument to bound method `update_entry` is incorrect: Expected `int | str | FVal | ... omitted 9 union elements`, found `dict[ChainID, tuple[EvmIndexer, EvmIndexer, EvmIndexer]]`
- rotkehlchen/tests/unit/test_evm_indexer_order.py:84:9: error[invalid-argument-type] Argument to bound method `update_entry` is incorrect: Expected `int | str | FVal | ... omitted 9 union elements`, found `dict[ChainID, tuple[EvmIndexer, EvmIndexer, EvmIndexer]]`
- rotkehlchen/tests/unit/test_evm_indexer_order.py:116:9: error[invalid-argument-type] Argument to bound method `update_entry` is incorrect: Expected `int | str | FVal | ... omitted 9 union elements`, found `dict[ChainID, tuple[EvmIndexer, EvmIndexer, EvmIndexer]]`
- Found 2152 diagnostics
+ Found 2148 diagnostics

core (https://github.com/home-assistant/core)
- homeassistant/components/hitron_coda/device_tracker.py:113:55: error[invalid-argument-type] Argument to function `get` is incorrect: Expected `CookieJar | MutableMapping[str, str] | None`, found `dict[str, str | Unknown | None]`
+ homeassistant/components/hitron_coda/device_tracker.py:113:55: error[invalid-argument-type] Argument to function `get` is incorrect: Expected `CookieJar | MutableMapping[str, str] | None`, found `dict[str, Unknown | None | str]`
- homeassistant/components/nederlandse_spoorwegen/diagnostics.py:91:9: error[invalid-assignment] Invalid subscript assignment with key of type `Literal["trip_details"]` and value of type `dict[str, int]` on object of type `dict[str, dict[str, None | str] | dict[str, Unknown | str | None] | None]`
- Found 12101 diagnostics
+ Found 12100 diagnostics

colour (https://github.com/colour-science/colour)
- colour/io/luts/lut.py:333:17: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `dict[str, ((x) -> Unknown) | bool] | dict[str, bool] | dict[str, str] | dict[str, str | ((x) -> Unknown)]`, found `dict[str, (x) -> Unknown]`
- Found 462 diagnostics
+ Found 461 diagnostics

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
- tests/extension/decimal/array.py:150:35: error[invalid-argument-type] Argument to bound method `_from_sequence` is incorrect: Expected `list[Decimal | int | float | str | tuple[int, Sequence[int], int]] | ndarray[tuple[Any, ...], dtype[Any]] | ExtensionArray`, found `list[Decimal]`
- tests/frame/test_frame.py:1774:53: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `list[str]`
- tests/frame/test_frame.py:1783:53: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `list[str]`
- tests/frame/test_frame.py:1792:53: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `list[str]`
- tests/frame/test_frame.py:1801:53: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `list[str]`
- tests/frame/test_frame.py:1828:53: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `list[str | Overload[(a: _SupportsArray[dtype[numpy.bool[builtins.bool] | integer[Any] | floating[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | integer[Any] | floating[Any]]]] | int | float | _NestedSequence[int | float], axis: None = None, dtype: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> floating[Any], (a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 3 union elements, axis: None = None, dtype: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> complexfloating[Any, Any], (a: _SupportsArray[dtype[timedelta64[timedelta | int | None]]] | _NestedSequence[_SupportsArray[dtype[timedelta64[timedelta | int | None]]]], axis: None = None, dtype: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> timedelta64[timedelta | int | None], [_ArrayT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT, [_ArrayT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements = None, *, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT, [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: None = None, *, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: Literal[False] | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None, keepdims: Literal[True, 1], *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> ndarray[tuple[Any, ...], dtype[_ScalarT]], [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, *, keepdims: builtins.bool | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT | ndarray[tuple[Any, ...], dtype[_ScalarT]], [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, *, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: builtins.bool | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT | ndarray[tuple[Any, ...], dtype[_ScalarT]], (a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements = None, out: None = None, keepdims: builtins.bool | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> Any]]`
- tests/frame/test_frame.py:1837:53: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `list[Overload[[_ScalarT](a: _SupportsArray[dtype[_ScalarT]] | _NestedSequence[_SupportsArray[dtype[_ScalarT]]], axis: None = None, dtype: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, [_ScalarT](a: _SupportsArray[dtype[_ScalarT]] | _NestedSequence[_SupportsArray[dtype[_ScalarT]]], axis: None = None, dtype: None = None, out: None = None, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT | ndarray[tuple[Any, ...], dtype[_ScalarT]], [_ScalarT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: Literal[False] | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, [_ScalarT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: None = None, *, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: Literal[False] | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, [_ScalarT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT | ndarray[tuple[Any, ...], dtype[_ScalarT]], [_ScalarT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, *, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT | ndarray[tuple[Any, ...], dtype[_ScalarT]], (a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements = None, out: None = None, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> Any, [_ArrayT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT, [_ArrayT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements = None, *, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT] | str | Overload[[_ScalarT](a: _SupportsArray[dtype[_ScalarT]] | _NestedSequence[_SupportsArray[dtype[_ScalarT]]], axis: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, (a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, out: None = None, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> Any, [_ArrayT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT, [_ArrayT](a: _Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, *, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., initial: int | float | complex | ... omitted 3 union elements = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT]]`
- tests/frame/test_frame.py:1853:17: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `dict[str, str]`
- tests/frame/test_frame.py:1865:17: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `dict[str, str]`
- tests/frame/test_frame.py:1877:17: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `dict[str, str]`
- tests/frame/test_frame.py:1903:17: error[invalid-argument-type] Argument to bound method `pivot_table` is incorrect: Expected `((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals] | Sequence[((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]] | Mapping[Any, ((Series[Any], /) -> str | bytes | date | ... omitted 9 union elements) | ufunc | Literal["all", "any", "corrwith", "count", "first", ... omitted 28 literals]]`, found `dict[str, str | Overload[(a: _SupportsArray[dtype[numpy.bool[builtins.bool] | integer[Any] | floating[Any]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | integer[Any] | floating[Any]]]] | int | float | _NestedSequence[int | float], axis: None = None, dtype: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> floating[Any], (a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 3 union elements, axis: None = None, dtype: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> complexfloating[Any, Any], (a: _SupportsArray[dtype[timedelta64[timedelta | int | None]]] | _NestedSequence[_SupportsArray[dtype[timedelta64[timedelta | int | None]]]], axis: None = None, dtype: None = None, out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> timedelta64[timedelta | int | None], [_ArrayT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT, [_ArrayT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements = None, *, out: _ArrayT, keepdims: builtins.bool | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ArrayT, [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: Literal[False] | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: None = None, *, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: Literal[False] | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT, [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None, keepdims: Literal[True, 1], *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> ndarray[tuple[Any, ...], dtype[_ScalarT]], [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, *, keepdims: builtins.bool | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT | ndarray[tuple[Any, ...], dtype[_ScalarT]], [_ScalarT](a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, *, dtype: type[_ScalarT] | dtype[_ScalarT] | _HasDType[dtype[_ScalarT]] | _HasNumPyDType[dtype[_ScalarT]], out: None = None, keepdims: builtins.bool | _NoValueType = ..., where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> _ScalarT | ndarray[tuple[Any, ...], dtype[_ScalarT]], (a: _SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool] | number[Any, int | float | complex]]]] | int | ... omitted 5 union elements, axis: SupportsIndex | Sequence[SupportsIndex] | None = None, dtype: type[Any] | dtype[Any] | _HasDType[dtype[Any]] | ... omitted 6 union elements = None, out: None = None, keepdims: builtins.bool | _NoValueType = ..., *, where: _SupportsArray[dtype[numpy.bool[builtins.bool]]] | _NestedSequence[_SupportsArray[dtype[numpy.bool[builtins.bool]]]] | builtins.bool | _NestedSequence[builtins.bool] | _NoValueType = ...) -> Any]]`
- tests/frame/test_frame.py:2104:11: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/frame/test_frame.py:2104:23: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/frame/test_frame.py:2107:11: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/frame/test_frame.py:2107:23: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/frame/test_frame.py:2127:11: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/frame/test_frame.py:2127:23: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/frame/test_frame.py:2129:11: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/frame/test_frame.py:2129:23: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/frame/test_frame.py:2264:11: error[type-assertion-failure] Type `Unknown` does not match asserted type `str`
- tests/frame/test_frame.py:2264:34: error[invalid-argument-type] Argument to bound method `to_html` is incorrect: Expected `Sequence[int | str] | int | Mapping[Hashable, str | int] | None`, found `dict[str, int]`
- tests/frame/test_frame.py:2649:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/frame/test_frame.py:2649:36: error[invalid-argument-type] Argument to bound method `rename_axis` is incorrect: Expected `Sequence[str] | dict[str | int, str] | ((...) -> Any) | None`, found `dict[str, str]`
- tests/frame/test_frame.py:2649:54: error[invalid-argument-type] Argument to bound method `rename_axis` is incorrect: Expected `Sequence[str] | dict[str | int, str] | ((...) -> Any) | None`, found `dict[str, str]`
- tests/frame/test_groupby.py:127:5: error[no-matching-overload] No overload of bound method `groupby` matches arguments
+ tests/indexes/test_indexes.py:1337:9: error[type-assertion-failure] Type `Index[Any | str]` does not match asserted type `Index[str]`
- tests/series/test_series.py:897:5: error[no-matching-overload] No overload of bound method `groupby` matches arguments
- tests/series/test_series.py:1314:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/series/test_series.py:1314:21: error[no-matching-overload] No overload of bound method `transform` matches arguments
- tests/series/test_series.py:1317:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/series/test_series.py:1317:21: error[no-matching-overload] No overload of bound method `transform` matches arguments
- tests/series/test_series.py:1319:11: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/series/test_series.py:1319:23: error[no-matching-overload] No overload of bound method `transform` matches arguments
- tests/series/test_series.py:1320:11: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/series/test_series.py:1320:23: error[no-matching-overload] No overload of bound method `transform` matches arguments
- tests/test_extension.py:22:24: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `MutableSequence[Decimal | int | float | str | tuple[int, Sequence[int], int]] | ndarray[tuple[Any, ...], dtype[Any]] | ExtensionArray`, found `list[Decimal]`
- tests/test_groupby.py:122:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/test_groupby.py:122:21: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:122:21: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:122:21: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:126:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame`
- tests/test_groupby.py:126:21: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:126:21: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:126:21: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:160:11: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:160:11: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:160:11: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:161:11: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:161:11: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:161:11: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:336:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame | Series[Any]`
- tests/test_groupby.py:337:13: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:337:13: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:337:13: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- tests/test_groupby.py:343:9: error[type-assertion-failure] Type `Unknown` does not match asserted type `DataFrame | Series[Any]`
- 

... (truncated 65 lines) ...

@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 9, 2026

Memory usage report

Summary

Project Old New Diff Outcome
prefect 705.00MB 705.00MB +0.00% (1.36kB)
flake8 47.89MB 47.89MB -0.01% (4.08kB) ⬇️
trio 117.77MB 117.74MB -0.02% (21.11kB) ⬇️
sphinx 265.13MB 265.10MB -0.01% (31.09kB) ⬇️

Significant changes

Click to expand detailed breakdown

prefect

Name Old New Diff Outcome
infer_definition_types 88.86MB 88.85MB -0.01% (8.77kB)
StaticClassLiteral<'db>::try_mro_ 6.06MB 6.07MB +0.14% (8.74kB)
is_redundant_with_impl 5.57MB 5.57MB +0.13% (7.62kB)
infer_expression_types_impl 60.75MB 60.74MB -0.01% (7.30kB)
IntersectionType<'db>::from_two_elements_::interned_arguments 346.76kB 341.43kB -1.54% (5.33kB)
is_redundant_with_impl::interned_arguments 5.35MB 5.36MB +0.07% (3.95kB)
infer_scope_types_impl 52.93MB 52.93MB -0.01% (3.04kB)
Specialization 2.51MB 2.52MB +0.12% (2.98kB)
IntersectionType 2.31MB 2.31MB +0.12% (2.90kB)
Type<'db>::class_member_with_policy_ 17.31MB 17.31MB -0.01% (1.85kB)
GenericAlias 1.17MB 1.17MB +0.15% (1.83kB)
StaticClassLiteral<'db>::try_mro_::interned_arguments 1.40MB 1.40MB +0.12% (1.76kB)
ClassType<'db>::nearest_disjoint_base_ 108.37kB 107.24kB -1.05% (1.13kB)
Type<'db>::member_lookup_with_policy_ 15.40MB 15.40MB -0.00% (768.00B)
infer_deferred_types 14.37MB 14.37MB -0.00% (708.00B)
... 10 more

flake8

Name Old New Diff Outcome
infer_expression_types_impl 1.07MB 1.07MB -0.09% (1008.00B) ⬇️
ClassType<'db>::nearest_disjoint_base_ 3.84kB 2.94kB -23.58% (928.00B) ⬇️
infer_scope_types_impl 1002.57kB 1002.15kB -0.04% (432.00B) ⬇️
StaticClassLiteral<'db>::try_mro_ 335.69kB 335.33kB -0.11% (364.00B) ⬇️
is_redundant_with_impl::interned_arguments 140.51kB 140.16kB -0.24% (352.00B) ⬇️
IntersectionType 72.96kB 72.63kB -0.45% (336.00B) ⬇️
UnionType 101.36kB 101.14kB -0.22% (224.00B) ⬇️
is_redundant_with_impl 140.46kB 140.27kB -0.13% (192.00B) ⬇️
Type<'db>::apply_specialization_::interned_arguments 202.50kB 202.34kB -0.08% (160.00B) ⬇️
Type<'db>::apply_specialization_ 216.62kB 216.51kB -0.05% (112.00B) ⬇️
StaticClassLiteral<'db>::try_mro_::interned_arguments 76.08kB 76.01kB -0.09% (72.00B) ⬇️

trio

Name Old New Diff Outcome
Type<'db>::class_member_with_policy_ 1.98MB 1.97MB -0.34% (6.89kB) ⬇️
Type<'db>::member_lookup_with_policy_ 1.67MB 1.66MB -0.32% (5.50kB) ⬇️
infer_definition_types 7.57MB 7.57MB -0.04% (3.25kB) ⬇️
IntersectionType<'db>::from_two_elements_::interned_arguments 59.55kB 57.23kB -3.90% (2.32kB) ⬇️
IntersectionType<'db>::from_two_elements_ 65.13kB 63.66kB -2.27% (1.48kB) ⬇️
Type<'db>::member_lookup_with_policy_::interned_arguments 870.09kB 868.77kB -0.15% (1.32kB) ⬇️
Type<'db>::class_member_with_policy_::interned_arguments 1.10MB 1.10MB -0.10% (1.12kB) ⬇️
infer_expression_types_impl 7.06MB 7.06MB -0.01% (996.00B) ⬇️
CallableType 572.79kB 573.42kB +0.11% (648.00B) ⬇️
ClassType<'db>::nearest_disjoint_base_ 26.55kB 25.99kB -2.13% (580.00B) ⬇️
FunctionType 1.50MB 1.50MB +0.02% (368.00B) ⬇️
StaticClassLiteral<'db>::try_mro_ 863.60kB 863.88kB +0.03% (288.00B) ⬇️
cached_protocol_interface 135.08kB 135.34kB +0.19% (264.00B) ⬇️
is_redundant_with_impl 479.04kB 479.27kB +0.05% (240.00B) ⬇️
UnionType 303.45kB 303.23kB -0.07% (224.00B) ⬇️
... 11 more

sphinx

Name Old New Diff Outcome
infer_expression_types_impl 21.51MB 21.50MB -0.03% (7.54kB) ⬇️
ClassType<'db>::nearest_disjoint_base_ 75.65kB 71.69kB -5.24% (3.96kB) ⬇️
Type<'db>::member_lookup_with_policy_ 6.10MB 6.09MB -0.05% (2.96kB) ⬇️
infer_definition_types 24.01MB 24.01MB -0.01% (2.78kB) ⬇️
infer_scope_types_impl 15.58MB 15.57MB -0.02% (2.62kB) ⬇️
Type<'db>::class_member_with_policy_ 7.55MB 7.55MB -0.03% (2.37kB) ⬇️
StaticClassLiteral<'db>::implicit_attribute_inner_ 2.37MB 2.37MB -0.05% (1.09kB) ⬇️
Type<'db>::apply_specialization_::interned_arguments 1.45MB 1.45MB -0.07% (1.02kB) ⬇️
StaticClassLiteral<'db>::implicit_attribute_inner_::interned_arguments 1.90MB 1.90MB -0.05% (960.00B) ⬇️
Type<'db>::apply_specialization_ 1.66MB 1.66MB -0.05% (944.00B) ⬇️
FunctionType 3.12MB 3.12MB -0.03% (936.00B) ⬇️
is_redundant_with_impl::interned_arguments 2.06MB 2.06MB -0.04% (880.00B) ⬇️
IntersectionType<'db>::from_two_elements_::interned_arguments 173.08kB 173.94kB +0.50% (880.00B) ⬇️
Type<'db>::member_lookup_with_policy_::interned_arguments 2.54MB 2.54MB -0.03% (832.00B) ⬇️
StaticClassLiteral<'db>::try_mro_ 2.11MB 2.11MB -0.04% (816.00B) ⬇️
... 26 more

@astral-sh-bot
Copy link

astral-sh-bot bot commented Mar 9, 2026

ecosystem-analyzer results

Lint rule Added Removed Changed
invalid-argument-type 1 102 4
no-matching-overload 0 58 0
type-assertion-failure 1 29 0
invalid-assignment 1 4 3
unresolved-attribute 2 0 0
unused-type-ignore-comment 0 1 0
Total 5 194 7

Full report with detailed diff (timing results)

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 9, 2026

Merging this PR will degrade performance by 9.83%

❌ 2 regressed benchmarks
✅ 24 untouched benchmarks
⏩ 30 skipped benchmarks1

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime colour_science 112.9 s 125.2 s -9.83%
WallTime pandas 81.1 s 86.9 s -6.67%

Comparing ibraheem/narrow-collection-tcx (d1e3a85) with main (3f94c6a)

Open in CodSpeed

Footnotes

  1. 30 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Comment on lines +5993 to +5994
let prev_multi_inference = self.set_multi_inference_state(MultiInferenceState::Ignore);
let was_in_multi_inference = self.context.set_multi_inference(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Orthogonal issue, so not for this PR, but: should this be more ergonomic? Should the former always imply the latter? It's really not clear to a reader what the difference in semantics between self.set_multi_inference_state and self.context.set_multi_inference is, or why you'd need to call one vs the other.

Copy link
Member Author

Choose a reason for hiding this comment

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

We're moving towards this direction, once we remove MultiInferenceState::Intersection this can just be a single "silent inference" flag.

@ibraheemdev ibraheemdev force-pushed the ibraheem/narrow-collection-tcx branch from ce0fc3f to d1e3a85 Compare March 12, 2026 21:48
@ibraheemdev
Copy link
Member Author

Will try to address the performance regression in a follow up PR.

@ibraheemdev ibraheemdev merged commit edfe6c1 into main Mar 12, 2026
50 of 51 checks passed
@ibraheemdev ibraheemdev deleted the ibraheem/narrow-collection-tcx branch March 12, 2026 22:44
ibraheemdev added a commit that referenced this pull request Mar 13, 2026
Instead of ignoring intermediate inference results, we can create a
temporary `TypeInferenceBuilder` and merge the chosen inference results
into the current region. This should hopefully reclaim some of the
performance regressions introduced by
#23844 and
#21210.
carljm added a commit that referenced this pull request Mar 13, 2026
* main: (94 commits)
  Fix shell injection via `shell=True` in subprocess calls (#23894)
  [ty] Refactor `relation.rs` to store state on a struct rather than passing around 7 arguments every time we recurse (#23837)
  Don't return code actions for non-Python documents (#23905)
  [ty] Make the default database truly statically infallible (#23929)
  [ty] Add `Download` button to ty playground which creates a zip export (#23478)
  [ty] Respect `kw_only` overwrites in dataclasses (#23930)
  [ty] Clarify in diagnostics that `from __future__ import annotations` only stringifies type annotations (#23928)
  [ty]  Add a `Copy Markdown` button to playground (#23002)
  [ty] Fix folding range classification of lines starting with `#` (#23831)
  [ty] Fix folding ranges for notebooks (#23830)
  [ty] fix too-many-cycle panics when inferring literal type loop variables (#23875)
  Add `RegularCallableTypeOf` and `into_regular_callable` in `ty_extensions` (#23909)
  [ty] treat properties as full structural types (#23925)
  [ty] Avoid duplicated work during multi-inference (#23923)
  [ty]: make `possibly-missing-attribute` ignored by default
  [ty]: split out `possibly-missing-submodule` from `possibly-missing-attribute`
  Update astral-sh/setup-uv action to v7.5.0 (#23922)
  [ty] Show truthiness in ConstraintSet display and simplify falsy error message (#23913)
  Bump 0.15.6 (#23919)
  [ty] Narrow type context during collection literal inference (#23844)
  ...
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.

Subclasses in dict values not inferred as subclasses

2 participants