Skip to content

Comments

[ty] Default-specialization of generic type aliases#21765

Merged
sharkdp merged 1 commit intomainfrom
david/default-specialize-1
Dec 3, 2025
Merged

[ty] Default-specialization of generic type aliases#21765
sharkdp merged 1 commit intomainfrom
david/default-specialize-1

Conversation

@sharkdp
Copy link
Contributor

@sharkdp sharkdp commented Dec 2, 2025

Summary

Implement default-specialization of generic type aliases (implicit or PEP-613) if they are used in a type expression without an explicit specialization.

closes astral-sh/ty#1690

Typing conformance

-generics_defaults_specialization.py:26:5: error[type-assertion-failure] Type `SomethingWithNoDefaults[int, str]` does not match asserted type `SomethingWithNoDefaults[int, DefaultStrT]`

That's exactly what we want ✔️

All other tests in this file pass as well, with the exception of this assertion, which is just wrong (at least according to our interpretation, type[Bar] != <class 'Bar'>). I checked that we do correctly default-specialize the type parameter which is not displayed in the diagnostic that we raise.

class Bar(SubclassMe[int, DefaultStrT]): ...

assert_type(Bar, type[Bar[str]])  # ty: Type `type[Bar[str]]` does not match asserted type `<class 'Bar'>`

Ecosystem impact

Looks like I should have included this last week 😎

Test Plan

Updated pre-existing tests and add a few new ones.

@sharkdp sharkdp added ty Multi-file analysis & type inference ecosystem-analyzer labels Dec 2, 2025
@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 2, 2025

Diagnostic diff on typing conformance tests

Changes were detected when running ty on typing conformance tests
--- old-output.txt	2025-12-02 20:50:07.128924253 +0000
+++ new-output.txt	2025-12-02 20:50:10.790957699 +0000
@@ -470,7 +470,6 @@
 generics_defaults_referential.py:37:10: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Literal[""]`
 generics_defaults_referential.py:94:1: error[type-assertion-failure] Type `type[Bar[Any, list[Any]]]` does not match asserted type `<class 'Bar'>`
 generics_defaults_referential.py:95:1: error[type-assertion-failure] Type `type[Bar[int, list[int]]]` does not match asserted type `<class 'Bar[int, list[int]]'>`
-generics_defaults_specialization.py:26:5: error[type-assertion-failure] Type `SomethingWithNoDefaults[int, str]` does not match asserted type `SomethingWithNoDefaults[int, DefaultStrT]`
 generics_defaults_specialization.py:30:15: error[invalid-type-arguments] Too many type arguments: expected between 0 and 1, got 2
 generics_defaults_specialization.py:45:1: error[type-assertion-failure] Type `type[Bar[str]]` does not match asserted type `<class 'Bar'>`
 generics_paramspec_basic.py:10:1: error[invalid-paramspec] The name of a `ParamSpec` (`NotIt`) must match the name of the variable it is assigned to (`WrongName`)
@@ -1029,4 +1028,4 @@
 typeddicts_usage.py:28:17: error[missing-typed-dict-key] Missing required key 'name' in TypedDict `Movie` constructor
 typeddicts_usage.py:28:18: error[invalid-key] Unknown key "title" for TypedDict `Movie`: Unknown key "title"
 typeddicts_usage.py:40:24: error[invalid-type-form] The special form `typing.TypedDict` is not allowed in type expressions
-Found 1031 diagnostics
+Found 1030 diagnostics

@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 2, 2025

mypy_primer results

Changes were detected when running on open source projects
beartype (https://github.com/beartype/beartype)
- beartype/_decor/decorcache.py:74:16: error[invalid-return-type] Return type does not match returned value: expected `BeartypeableT@BeartypeReturn | ((BeartypeableT@BeartypeConfedDecorator, /) -> BeartypeableT@BeartypeConfedDecorator)`, found `BeartypeableT@beartype | BeartypeableT@BeartypeReturn | ((BeartypeableT@BeartypeConfedDecorator, /) -> BeartypeableT@BeartypeConfedDecorator)`
- beartype/_decor/decorcache.py:130:5: error[invalid-assignment] Invalid subscript assignment with key of type `BeartypeConf` and value of type `def _beartype_confed(obj: BeartypeableT@beartype) -> BeartypeableT@beartype` on object of type `dict[BeartypeConf, (BeartypeableT@BeartypeConfedDecorator, /) -> BeartypeableT@BeartypeConfedDecorator]`
- beartype/_decor/decorcache.py:133:12: error[invalid-return-type] Return type does not match returned value: expected `BeartypeableT@BeartypeReturn | ((BeartypeableT@BeartypeConfedDecorator, /) -> BeartypeableT@BeartypeConfedDecorator)`, found `def _beartype_confed(obj: BeartypeableT@beartype) -> BeartypeableT@beartype`
- beartype/_decor/decormain.py:93:20: error[invalid-return-type] Return type does not match returned value: expected `BeartypeableT@BeartypeReturn | ((BeartypeableT@BeartypeConfedDecorator, /) -> BeartypeableT@BeartypeConfedDecorator)`, found `BeartypeableT@beartype`
- Found 496 diagnostics
+ Found 492 diagnostics

paasta (https://github.com/yelp/paasta)
- paasta_tools/metrics/metastatus_lib.py:591:5: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `(Sequence[_GenericNodeT@_GenericNodeSortFunctionT], /) -> Sequence[_GenericNodeT@_GenericNodeSortFunctionT]`
+ paasta_tools/metrics/metastatus_lib.py:591:5: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `(Sequence[Unknown], /) -> Sequence[Unknown]`
- paasta_tools/metrics/metastatus_lib.py:776:5: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `(Sequence[_GenericNodeT@_GenericNodeSortFunctionT], /) -> Sequence[_GenericNodeT@_GenericNodeSortFunctionT]`
+ paasta_tools/metrics/metastatus_lib.py:776:5: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `(Sequence[Unknown], /) -> Sequence[Unknown]`
- paasta_tools/metrics/metastatus_lib.py:815:5: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `(Sequence[_GenericNodeT@_GenericNodeSortFunctionT], /) -> Sequence[_GenericNodeT@_GenericNodeSortFunctionT]`
+ paasta_tools/metrics/metastatus_lib.py:815:5: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `(Sequence[Unknown], /) -> Sequence[Unknown]`

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/specs/openapi/negative/mutations.py:164:89: warning[possibly-missing-attribute] Attribute `__name__` may be missing on object of type `Unknown | ((MutationContext, (SearchStrategy[Unknown], /) -> Unknown, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None])`
- src/schemathesis/specs/openapi/negative/mutations.py:145:25: error[invalid-assignment] Object of type `T@Draw` is not assignable to `list[(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]]`
- src/schemathesis/specs/openapi/negative/mutations.py:145:30: error[invalid-argument-type] Argument is incorrect: Expected `SearchStrategy[T@Draw]`, found `SearchStrategy[list[(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]]]`
- src/schemathesis/specs/openapi/negative/mutations.py:152:25: error[invalid-assignment] Object of type `T@Draw` is not assignable to `list[(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]]`
- src/schemathesis/specs/openapi/negative/mutations.py:152:30: error[invalid-argument-type] Argument is incorrect: Expected `SearchStrategy[T@Draw]`, found `SearchStrategy[list[(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]]]`
- src/schemathesis/specs/openapi/negative/mutations.py:162:28: error[call-non-callable] Object of type `T@Draw` is not callable
- src/schemathesis/specs/openapi/negative/mutations.py:164:60: error[unresolved-attribute] Object of type `T@Draw` has no attribute `is_enabled`
- src/schemathesis/specs/openapi/negative/mutations.py:164:89: error[unresolved-attribute] Object of type `(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]` has no attribute `__name__`
- src/schemathesis/specs/openapi/negative/mutations.py:231:72: error[unresolved-attribute] Object of type `T@Draw` has no attribute `is_enabled`
- src/schemathesis/specs/openapi/negative/mutations.py:248:9: error[invalid-argument-type] Argument is incorrect: Expected `str | None`, found `T@Draw`
- src/schemathesis/specs/openapi/negative/mutations.py:288:27: error[invalid-argument-type] Argument to bound method `remove` is incorrect: Expected `str`, found `T@Draw`
- src/schemathesis/specs/openapi/negative/mutations.py:292:63: error[unresolved-attribute] Object of type `T@Draw` has no attribute `is_enabled`
- src/schemathesis/specs/openapi/negative/mutations.py:297:46: error[invalid-argument-type] Argument to function `prevent_unsatisfiable_schema` is incorrect: Expected `str`, found `T@Draw`
- src/schemathesis/specs/openapi/negative/mutations.py:361:32: error[not-iterable] Object of type `T@Draw` is not iterable
- src/schemathesis/specs/openapi/negative/mutations.py:361:37: error[invalid-argument-type] Argument is incorrect: Expected `SearchStrategy[T@Draw]`, found `SearchStrategy[list[Unknown]]`
- src/schemathesis/specs/openapi/negative/mutations.py:390:12: error[unresolved-attribute] Object of type `T@Draw` has no attribute `is_enabled`
- src/schemathesis/specs/openapi/negative/mutations.py:393:20: error[unresolved-attribute] Object of type `T@Draw` has no attribute `is_enabled`
- src/schemathesis/specs/openapi/negative/mutations.py:393:49: error[unresolved-attribute] Object of type `(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]` has no attribute `__name__`
+ src/schemathesis/specs/openapi/negative/mutations.py:393:49: error[unresolved-attribute] Object of type `(MutationContext, (SearchStrategy[Unknown], /) -> Unknown, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]` has no attribute `__name__`
- src/schemathesis/specs/openapi/negative/mutations.py:547:37: error[unresolved-attribute] Object of type `T@Draw` has no attribute `is_enabled`
- src/schemathesis/specs/openapi/negative/mutations.py:607:12: error[invalid-return-type] Return type does not match returned value: expected `tuple[(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None], ...]`, found `T@Draw`
- src/schemathesis/specs/openapi/negative/mutations.py:607:17: error[invalid-argument-type] Argument is incorrect: Expected `SearchStrategy[T@Draw]`, found `SearchStrategy[list[(MutationContext, (SearchStrategy[T@Draw], /) -> T@Draw, dict[str, Any], /) -> tuple[MutationResult, MutationMetadata | None]]]`
- Found 290 diagnostics
+ Found 272 diagnostics

freqtrade (https://github.com/freqtrade/freqtrade)
- freqtrade/data/converter/converter.py:77:12: error[no-matching-overload] No overload of bound method `aggregate` matches arguments
- freqtrade/data/converter/trade_converter_kraken.py:59:33: error[invalid-argument-type] Argument to function `read_csv` is incorrect: Expected `MutableSequence[HashableT] | ndarray[tuple[int], dtype[GenericT]] | tuple[HashableT, ...] | range | None`, found `list[Unknown | str]`
- freqtrade/data/metrics.py:351:18: error[no-matching-overload] No overload of function `std` matches arguments
- freqtrade/data/metrics.py:378:16: error[no-matching-overload] No overload of function `std` matches arguments
- freqtrade/exchange/binance_public_data.py:285:33: error[invalid-argument-type] Argument to function `read_csv` is incorrect: Expected `MutableSequence[HashableT] | ndarray[tuple[int], dtype[GenericT]] | tuple[HashableT, ...] | range | None`, found `list[Unknown | str]`
- freqtrade/exchange/binance_public_data.py:371:9: error[invalid-argument-type] Argument to function `read_csv` is incorrect: Expected `MutableSequence[HashableT] | ndarray[tuple[int], dtype[GenericT]] | tuple[HashableT, ...] | range | None`, found `list[Unknown | str]`
- freqtrade/freqai/data_kitchen.py:179:30: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Sequence[Unknown] | Iterable[Sequence[Unknown] | ndarray[tuple[int], dtype[GenericT]] | Series[Any] | ... omitted 3 union elements] | Series[Any] | ... omitted 4 union elements`, found `Unknown | _Buffer | _SupportsArray[dtype[Any]] | ... omitted 7 union elements`
+ freqtrade/freqai/data_kitchen.py:179:30: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Sequence[Unknown] | Iterable[Sequence[Unknown] | ndarray[tuple[int], dtype[Any]] | Series[Any] | ... omitted 3 union elements] | Series[Any] | ... omitted 4 union elements`, found `Unknown | _Buffer | _SupportsArray[dtype[Any]] | ... omitted 7 union elements`
- freqtrade/freqai/freqai_interface.py:490:13: error[invalid-assignment] Object of type `ndarray[tuple[int], dtype[float64]]` is not assignable to attribute `DI_values` of type `ndarray[tuple[Any, ...], dtype[_ScalarT]]`
- freqtrade/optimize/optimize_reports/optimize_reports.py:210:28: error[no-matching-overload] No overload of bound method `groupby` matches arguments
+ freqtrade/optimize/optimize_reports/optimize_reports.py:215:84: error[invalid-argument-type] Argument to function `_generate_result_line` is incorrect: Expected `str | list[str]`, found `str | bytes | date | ... omitted 10 union elements`
- Found 695 diagnostics
+ Found 688 diagnostics

Tanjun (https://github.com/FasterSpeeding/Tanjun)
- tanjun/annotations.py:1469:46: error[invalid-type-form] Variable of type `type[_EnumT@__getitem__]` is not allowed in a type expression
+ tanjun/annotations.py:1469:46: error[invalid-type-form] Variable of type `type[Unknown]` is not allowed in a type expression
- tanjun/annotations.py:1601:29: error[invalid-type-form] Variable of type `type[_T@_annotated]` is not allowed in a type expression
+ tanjun/annotations.py:1601:29: error[invalid-type-form] Variable of type `type[Unknown]` is not allowed in a type expression
- tanjun/annotations.py:2206:64: error[invalid-type-form] Variable of type `type[_T@__getitem__]` is not allowed in a type expression
+ tanjun/annotations.py:2206:64: error[invalid-type-form] Variable of type `type[Unknown]` is not allowed in a type expression
- tanjun/dependencies/data.py:160:70: error[invalid-type-form] Variable of type `type[_T@make_lc_resolver]` is not allowed in a type expression
+ tanjun/dependencies/data.py:160:70: error[invalid-type-form] Variable of type `type[Unknown]` is not allowed in a type expression

discord.py (https://github.com/Rapptz/discord.py)
- discord/app_commands/transformers.py:238:22: error[invalid-type-form] Variable of type `Self@__or__` is not allowed in a type expression
+ discord/ext/commands/bot.py:501:69: warning[unused-ignore-comment] Unused blanket `type: ignore` directive
- discord/ext/commands/bot.py:424:37: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `(ContextT@UserCheck, /) -> bool | Coroutine[Any, Any, bool]`, found `(ContextT@add_check, /) -> bool | Coroutine[Any, Any, bool]`
- discord/ext/commands/bot.py:426:33: error[invalid-argument-type] Argument to bound method `append` is incorrect: Expected `(ContextT@UserCheck, /) -> bool | Coroutine[Any, Any, bool]`, found `(ContextT@add_check, /) -> bool | Coroutine[Any, Any, bool]`
- discord/ext/commands/bot.py:449:22: error[invalid-argument-type] Argument to bound method `remove` is incorrect: Expected `(ContextT@UserCheck, /) -> bool | Coroutine[Any, Any, bool]`, found `(ContextT@remove_check, /) -> bool | Coroutine[Any, Any, bool]`
- discord/ext/commands/core.py:1146:9: error[invalid-assignment] Object of type `((CogT@Command, ContextT@before_invoke, /) -> Coroutine[Any, Any, Any]) | ((ContextT@before_invoke, /) -> Coroutine[Any, Any, Any])` is not assignable to attribute `_before_invoke` of type `((CogT@Hook, ContextT@Hook, /) -> Coroutine[Any, Any, Any]) | ((ContextT@Hook, /) -> Coroutine[Any, Any, Any]) | None`
- discord/ext/commands/core.py:1177:9: error[invalid-assignment] Object of type `((CogT@Command, ContextT@after_invoke, /) -> Coroutine[Any, Any, Any]) | ((ContextT@after_invoke, /) -> Coroutine[Any, Any, Any])` is not assignable to attribute `_after_invoke` of type `((CogT@Hook, ContextT@Hook, /) -> Coroutine[Any, Any, Any]) | ((ContextT@Hook, /) -> Coroutine[Any, Any, Any]) | None`
- Found 566 diagnostics
+ Found 561 diagnostics

meson (https://github.com/mesonbuild/meson)
- mesonbuild/interpreter/interpreter.py:398:9: error[no-matching-overload] No overload of bound method `update` matches arguments
- mesonbuild/interpreter/interpreter.py:450:9: error[no-matching-overload] No overload of bound method `update` matches arguments
- mesonbuild/interpreterbase/baseobjects.py:70:17: error[no-matching-overload] No overload of bound method `update` matches arguments
- mesonbuild/interpreterbase/baseobjects.py:137:26: error[invalid-argument-type] Argument is incorrect: Expected `TYPE_op_arg@TYPE_op_func`, found `Self@operator_call`
- mesonbuild/interpreterbase/baseobjects.py:137:32: error[invalid-argument-type] Argument is incorrect: Expected `TYPE_op_arg@TYPE_op_func`, found `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`
- mesonbuild/interpreterbase/baseobjects.py:139:45: error[invalid-argument-type] Argument is incorrect: Expected `TYPE_op_arg@TYPE_op_func`, found `Self@operator_call`
- mesonbuild/interpreterbase/baseobjects.py:139:51: error[invalid-argument-type] Argument is incorrect: Expected `TYPE_op_arg@TYPE_op_func`, found `Sequence[Divergent] | int | dict[str, Divergent] | ... omitted 5 union elements`
- mesonbuild/interpreterbase/interpreterbase.py:569:28: error[invalid-argument-type] Argument is incorrect: Expected `InterpreterObjectTypeVar@HolderMapType`, found `HoldableObject | int | str | ... omitted 8 union elements`
- mesonbuild/interpreterbase/interpreterbase.py:573:32: error[invalid-argument-type] Argument is incorrect: Expected `InterpreterObjectTypeVar@HolderMapType`, found `HoldableObject | int | str | ... omitted 8 union elements`
- Found 1926 diagnostics
+ Found 1917 diagnostics

zope.interface (https://github.com/zopefoundation/zope.interface)
- src/zope/interface/interface.py:978:22: error[invalid-type-form] Variable of type `Self@__or__` is not allowed in a type expression
- src/zope/interface/interface.py:982:29: error[invalid-type-form] Variable of type `Self@__ror__` is not allowed in a type expression
- Found 421 diagnostics
+ Found 419 diagnostics

vision (https://github.com/pytorch/vision)
- references/depth/stereo/train.py:508:17: error[unresolved-attribute] Object of type `ndarray[tuple[Any, ...], dtype[_ScalarT]]` has no attribute `load_state_dict`
+ references/depth/stereo/train.py:508:17: error[unresolved-attribute] Object of type `ndarray[tuple[Any, ...], dtype[Unknown]]` has no attribute `load_state_dict`

pandera (https://github.com/pandera-dev/pandera)
- pandera/backends/pandas/checks.py:34:20: error[no-matching-overload] No overload of bound method `groupby` matches arguments
- pandera/backends/pandas/checks.py:34:20: error[no-matching-overload] No overload of bound method `groupby` matches arguments
+ tests/mypy/pandas_modules/pandas_series.py:9:4: error[invalid-argument-type] Argument to function `fn` is incorrect: Expected `Series[str]`, found `Series[str | float]`
+ tests/mypy/pandas_modules/pandas_series.py:12:4: error[invalid-argument-type] Argument to function `fn` is incorrect: Expected `Series[str]`, found `Series[float]`

setuptools (https://github.com/pypa/setuptools)
- setuptools/_vendor/typing_extensions.py:2074:29: error[invalid-type-form] Variable of type `Self@__or__` is not allowed in a type expression
- setuptools/_vendor/typing_extensions.py:2077:36: error[invalid-type-form] Variable of type `Self@__ror__` is not allowed in a type expression
- Found 1262 diagnostics
+ Found 1260 diagnostics

strawberry (https://github.com/strawberry-graphql/strawberry)
+ strawberry/types/field.py:200:25: error[not-iterable] Object of type `object` is not iterable
- strawberry/types/lazy_type.py:59:22: error[invalid-type-form] Variable of type `Self@__or__` is not allowed in a type expression
- strawberry/types/lazy_type.py:59:28: error[invalid-type-form] Variable of type `Other@__or__` is not allowed in a type expression
- Found 400 diagnostics
+ Found 399 diagnostics

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
- src/hydra_zen/third_party/beartype.py:129:31: error[invalid-argument-type] Argument to function `coerce_sequences` is incorrect: Argument type `_T@validates_with_beartype | BeartypeableT@BeartypeReturn | ((BeartypeableT@BeartypeConfedDecorator, /) -> BeartypeableT@BeartypeConfedDecorator)` does not satisfy upper bound `(...) -> Unknown` of type variable `_T`
- Found 539 diagnostics
+ Found 538 diagnostics

xarray (https://github.com/pydata/xarray)
- doc/examples/weather-data.ipynb:cell 3:6:36: error[unsupported-operator] Operator `/` is unsupported between objects of type `ndarray[tuple[int], dtype[GenericT]]` and `float`
- xarray/core/accessor_str.py:295:20: error[invalid-type-form] Variable of type `def slice(self, start: int | Any | None = None, stop: int | Any | None = None, step: int | Any | None = None) -> T_DataArray@StringAccessor` is not allowed in a type expression
+ xarray/core/accessor_str.py:295:20: error[invalid-type-form] Variable of type `def slice(self, start: int | Any | None = None, stop: int | Any | None = None, step: int | Any | None = None) -> Unknown` is not allowed in a type expression
- xarray/core/common.py:1121:45: error[invalid-argument-type] Argument is incorrect: Expected `T_DataArray@T_Group | _DummyGroup[Unknown]`, found `DataArray`
- xarray/core/dataarray.py:7086:22: error[invalid-argument-type] Argument is incorrect: Expected `T_DataArray@T_Group | _DummyGroup[Unknown]`, found `Hashable`
- xarray/core/dataset.py:10190:22: error[invalid-argument-type] Argument is incorrect: Expected `T_DataArray@T_Group | _DummyGroup[Unknown]`, found `Hashable`
- xarray/core/groupby.py:281:16: error[invalid-return-type] Return type does not match returned value: expected `tuple[T_DataArray@T_Group | _DummyGroup[Unknown], T_DataWithCoords@_ensure_1d, Hashable, list[Hashable]]`, found `tuple[DataArray, Any, Unknown, list[Hashable]]`
- xarray/core/groupby.py:423:34: error[invalid-argument-type] Argument is incorrect: Expected `T_DataArray@T_Group | _DummyGroup[Unknown]`, found `(DataArray & ~ndarray[tuple[object, ...], dtype[object]] & ~Top[Index[Any]] & ~Grouper & ~Top[Mapping[Unknown, object]]) | (Sequence[Hashable] & Variable & ~ndarray[tuple[object, ...], dtype[object]] & ~Top[Index[Any]] & ~Grouper & ~Top[Mapping[Unknown, object]]) | (IndexVariable & ~ndarray[tuple[object, ...], dtype[object]] & ~Top[Index[Any]] & ~Grouper & ~Top[Mapping[Unknown, object]])`
- xarray/core/groupby.py:439:26: error[invalid-argument-type] Argument is incorrect: Expected `T_DataArray@T_Group | _DummyGroup[Unknown]`, found `Hashable`
- xarray/core/groupby.py:475:20: error[invalid-assignment] Object of type `DataArray` is not assignable to `T_DataArray@T_Group | _DummyGroup[Unknown]`
- xarray/core/groupby.py:488:20: error[invalid-assignment] Object of type `DataArray` is not assignable to `T_DataArray@T_Group | _DummyGroup[Unknown]`
- xarray/core/groupby.py:500:36: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `DataArray`, found `T_DataWithCoords@_resolve_group`
- xarray/core/groupby.py:680:28: error[invalid-argument-type] Argument to function `_ensure_1d` is incorrect: Expected `T_DataArray@T_Group | _DummyGroup[Unknown]`, found `DataArray`
- xarray/core/groupby.py:684:13: error[invalid-assignment] Object of type `None` is not assignable to attribute `group1d` of type `T_DataArray@T_Group | _DummyGroup[Unknown]`
- xarray/groupers.py:413:21: error[invalid-assignment] Object of type `DataArray` is not assignable to `T_DataArray@T_Group | _DummyGroup[Unknown]`
- xarray/groupers.py:438:55: warning[possibly-missing-attribute] Attribute `dtype` may be missing on object of type `T_DataArray@T_Group | _DummyGroup[Unknown]`
- xarray/groupers.py:944:46: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | bool[bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | bool[bool]]], ...], /) -> ndarray[tuple[Any, ...], str], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], str], (key: str, /) -> ndarray[tuple[int, ...], dtype[Any]], (key: list[str], /) -> ndarray[tuple[int, ...], dtype[void]]]` cannot be called with key of type `Any | slice[Any, Any, Any]` on object of type `ndarray[tuple[int, ...], str]`
- xarray/groupers.py:950:13: error[no-matching-overload] No overload of bound method `groupby` matches arguments
- xarray/groupers.py:997:49: error[invalid-argument-type] Method `__getitem__` of type `Overload[(key: ndarray[tuple[Any, ...], dtype[integer[Any] | bool[bool]]] | tuple[ndarray[tuple[Any, ...], dtype[integer[Any] | bool[bool]]], ...], /) -> ndarray[tuple[Any, ...], str], (key: SupportsIndex | tuple[SupportsIndex, ...], /) -> Any, (key: SupportsIndex | slice[Any, Any, Any] | EllipsisType | ... omitted 5 union elements, /) -> ndarray[tuple[Any, ...], str], (key: str, /) -> ndarray[tuple[int, ...], dtype[Any]], (key: list[str], /) -> ndarray[tuple[int, ...], dtype[void]]]` cannot be called with key of type `Any` on object of type `ndarray[tuple[int, ...], str]`
- xarray/structure/combine.py:158:26: error[unsupported-operator] Operator `-` is unsupported between objects of type `ndarray[tuple[int], dtype[GenericT]] | ExtensionArray` and `Literal[1]`
+ xarray/structure/combine.py:158:26: error[unsupported-operator] Operator `-` is unsupported between objects of type `ndarray[tuple[int], dtype[Any]] | ExtensionArray` and `Literal[1]`
- xarray/tests/test_coding_times.py:600:22: error[no-matching-overload] No overload of function `__new__` matches arguments
- xarray/tests/test_coding_times.py:616:16: error[no-matching-overload] No overload of function `__new__` matches arguments
- xarray/tests/test_coding_times.py:1508:11: error[no-matching-overload] No overload of function `__new__` matches arguments
- xarray/tests/test_coding_times.py:1530:11: error[no-matching-overload] No overload of function `__new__` matches arguments
- xarray/tests/test_cupy.py:24:40: error[unsupported-operator] Operator `/` is unsupported between objects of type `ndarray[tuple[int], dtype[GenericT]]` and `float`
- xarray/tests/test_formatting_html.py:98:40: error[unsupported-operator] Operator `/` is unsupported between objects of type `ndarray[tuple[int], dtype[GenericT]]` and `float`
- xarray/tests/test_groupby.py:2804:40: error[unsupported-operator] Operator `/` is unsupported between objects of type `ndarray[tuple[int], dtype[GenericT]]` and `float`
- xarray/tests/test_groupby.py:3165:46: error[invalid-argument-type] Argument to bound method `factorize` is incorrect: Expected `T_DataArray@T_Group | _DummyGroup[Unknown]`, found `DataArray`
- xarray/tests/test_rolling.py:709:9: error[no-matching-overload] No overload of function `assert_allclose` matches arguments
- xarray/tests/test_rolling.py:730:9: error[no-matching-overload] No overload of function `assert_allclose` matches arguments
- xarray/tests/test_rolling.py:758:9: error[no-matching-overload] No overload of function `assert_allclose` matches arguments
- xarray/tests/test_ufuncs.py:37:87: error[invalid-assignment] Object of type `list[int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 4 union elements]` is not assignable to `list[int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements]`
- xarray/tests/test_ufuncs.py:46:30: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:46:53: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:47:30: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:47:53: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:48:30: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:48:49: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:49:30: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:49:49: error[unsupported-operator] Operator `+` is unsupported between objects of type `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements` and `Literal[1]`
- xarray/tests/test_ufuncs.py:53:87: error[invalid-assignment] Object of type `list[int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 4 union elements]` is not assignable to `list[int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements]`
- xarray/tests/test_ufuncs.py:62:43: error[unsupported-operator] Operator `*` is unsupported between objects of type `float` and `int | float | ndarray[tuple[Any, ...], dtype[_ScalarT]] | ... omitted 3 union elements`
- Found 1733 diagnostics
+ Found 1694 diagnostics

scipy-stubs (https://github.com/scipy/scipy-stubs)
- scipy-stubs/special/_ufuncs.pyi:762:43: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:764:43: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:766:45: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:768:41: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:770:48: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:788:43: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:790:43: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:792:45: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:794:42: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:796:45: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:814:45: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:816:43: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:818:47: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:836:57: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:838:43: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:840:46: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:842:45: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:844:43: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:846:48: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:848:47: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1014:59: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1016:62: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1018:61: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1045:59: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1047:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1049:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1051:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1053:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1077:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1089:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1101:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1145:63: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1147:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1149:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1165:63: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1167:58: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1169:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1171:66: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1200:61: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1202:58: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1204:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1206:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1208:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1210:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1212:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1214:66: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1238:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1250:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1262:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1331:59: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1333:63: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1335:58: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1337:58: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1339:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1341:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1343:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1345:67: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1380:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1392:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1405:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1417:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1430:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1622:75: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1625:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1629:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1633:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1637:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1641:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1645:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1665:66: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1669:68: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1673:64: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1677:86: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1681:86: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1685:86: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1689:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1693:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1697:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1701:76: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1705:78: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1709:78: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1729:66: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1733:72: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1742:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1752:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1762:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1767:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1771:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1775:77: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1779:78: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1783:78: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1787:78: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1853:87: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1863:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1874:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1885:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1896:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1907:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1918:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1929:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1940:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1974:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1986:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:1998:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2010:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2039:82: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2043:84: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2047:79: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2057:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2068:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2079:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2090:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2101:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2112:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2123:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2134:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2145:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2156:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2167:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2178:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2206:82: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2210:90: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2220:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.pyi:2231:9: error[invalid-parameter-default] Default value of type `None` is not assignable to annotated parameter type `tuple[_MaybeOutT] | _MaybeOutT`
- scipy-stubs/special/_ufuncs.

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

prefect (https://github.com/PrefectHQ/prefect)
-     memo metadata = ~159MB
+     memo metadata = ~167MB

@astral-sh-bot
Copy link

astral-sh-bot bot commented Dec 2, 2025

ecosystem-analyzer results

Lint rule Added Removed Changed
no-matching-overload 3 453 0
type-assertion-failure 24 171 184
unsupported-operator 1 283 1
invalid-argument-type 5 239 26
invalid-return-type 0 206 3
invalid-parameter-default 0 134 3
invalid-assignment 0 52 3
invalid-context-manager 0 0 32
unresolved-attribute 9 14 2
invalid-type-form 0 9 8
non-subscriptable 2 15 0
unused-ignore-comment 8 0 0
not-iterable 1 3 1
possibly-missing-attribute 1 2 0
unsupported-base 2 0 0
call-non-callable 0 1 0
invalid-method-override 0 1 0
Total 56 1,583 263

Full report with detailed diff (timing results)

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 2, 2025

CodSpeed Performance Report

Merging #21765 will degrade performances by 5.37%

Comparing david/default-specialize-1 (c6a2501) with main (392a8e4)

Summary

⚡ 1 improvement
❌ 1 (👁 1) regression
✅ 20 untouched
⏩ 30 skipped1

Benchmarks breakdown

Mode Benchmark BASE HEAD Change
WallTime large[pydantic] 207.9 s 198.8 s +4.56%
👁 WallTime medium[colour-science] 88.7 s 93.8 s -5.37%

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.

@sharkdp sharkdp marked this pull request as ready for review December 2, 2025 20:37
@sharkdp sharkdp marked this pull request as draft December 2, 2025 20:43
@sharkdp sharkdp force-pushed the david/default-specialize-1 branch from fa8f088 to c6a2501 Compare December 2, 2025 20:47
@sharkdp sharkdp marked this pull request as ready for review December 2, 2025 21:53
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

Lovely!

@sharkdp sharkdp merged commit e6ddeed into main Dec 3, 2025
43 of 44 checks passed
@sharkdp sharkdp deleted the david/default-specialize-1 branch December 3, 2025 08:10
dcreager added a commit that referenced this pull request Dec 3, 2025
* origin/main:
  [ty] Improve `@override`, `@final` and Liskov checks in cases where there are multiple reachable definitions (#21767)
  [ty] Extend `invalid-explicit-override` to also cover properties decorated with `@override` that do not override anything (#21756)
  [ty] Enable LRU collection for parsed module (#21749)
  [ty] Support typevar-specialized dynamic types in generic type aliases (#21730)
  Add token based `parenthesized_ranges` implementation (#21738)
  [ty] Default-specialization of generic type aliases (#21765)
  [ty] Suppress false positives when `dataclasses.dataclass(...)(cls)` is called imperatively (#21729)
  [syntax-error] Default type parameter followed by non-default type parameter (#21657)
  new module for parsing ranged suppressions (#21441)
  [ty] `type[T]` is assignable to an inferable typevar (#21766)
  Fix syntax error false positives for `await` outside functions (#21763)
  [ty] Improve diagnostics for unsupported comparison operations (#21737)
  Move `Token`, `TokenKind` and `Tokens` to `ruff-python-ast` (#21760)
  [ty] Don't confuse multiple occurrences of `typing.Self` when binding bound methods (#21754)
  Use our org-wide Renovate preset (#21759)
  Delete `my-script.py` (#21751)
  [ty] Move `all_members`, and related types/routines, out of `ide_support.rs` (#21695)
dcreager added a commit that referenced this pull request Dec 3, 2025
* origin/main:
  [ty] Reachability constraints: minor documentation fixes (#21774)
  [ty] Fix non-determinism in `ConstraintSet.specialize_constrained` (#21744)
  [ty] Improve `@override`, `@final` and Liskov checks in cases where there are multiple reachable definitions (#21767)
  [ty] Extend `invalid-explicit-override` to also cover properties decorated with `@override` that do not override anything (#21756)
  [ty] Enable LRU collection for parsed module (#21749)
  [ty] Support typevar-specialized dynamic types in generic type aliases (#21730)
  Add token based `parenthesized_ranges` implementation (#21738)
  [ty] Default-specialization of generic type aliases (#21765)
  [ty] Suppress false positives when `dataclasses.dataclass(...)(cls)` is called imperatively (#21729)
  [syntax-error] Default type parameter followed by non-default type parameter (#21657)
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.

Default-specialize generic implicit type aliases

2 participants