fix reduce(gcd, ...) returns SupportsIndex instead of int #2866#2898
fix reduce(gcd, ...) returns SupportsIndex instead of int #2866#2898asukaminato0721 wants to merge 2 commits intofacebook:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes a type inference precision issue where reduce(gcd, ...) could be inferred as returning SupportsIndex instead of int (issue #2866), by adjusting callable subtyping constraint ordering and adding regression coverage.
Changes:
- Change callable subtyping to check return types before parameter types to improve quantified type variable inference precision (e.g.,
math.gcdcase). - Add regression test covering
reduce(gcd, ...)returning anintin a realistic pattern. - Ensure tuple subscript inference is only applied when
__getitem__is the builtintuple.__getitem__, adding a test for tuple subclasses that override__getitem__.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pyrefly/lib/solver/subset.rs | Adjustes callable subtyping check order (return before params) to improve quantified var solving precision. |
| pyrefly/lib/test/calls.rs | Adds regression test for the reduce(gcd, ...) inference scenario from #2866. |
| pyrefly/lib/alt/expr.rs | Gates tuple-specific subscript inference on whether the type uses builtin tuple.__getitem__. |
| pyrefly/lib/alt/class/tuple.rs | Adds helper to detect whether a tuple(-subclass) uses builtin __getitem__. |
| pyrefly/lib/test/tuple.rs | Adds regression test ensuring overridden __getitem__ on tuple subclasses is respected during subscripting. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Diff from mypy_primer, showing the effect of this PR on open source code: anyio (https://github.com/agronholm/anyio)
- ERROR src/anyio/_core/_eventloop.py:77:34-38: Argument `(**tuple[*PosArgsT]) -> Awaitable[T_Retval]` is not assignable to parameter `func` with type `(**tuple[*@_]) -> Awaitable[@_]` in function `anyio.abc._eventloop.AsyncBackend.run` [bad-argument-type]
+ ERROR src/anyio/_core/_eventloop.py:77:34-38: Argument `(**tuple[*PosArgsT]) -> Awaitable[T_Retval]` is not assignable to parameter `func` with type `(**tuple[*@_]) -> Awaitable[T_Retval]` in function `anyio.abc._eventloop.AsyncBackend.run` [bad-argument-type]
- ERROR src/anyio/_core/_fileio.py:480:41-58: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `anyio.to_thread.run_sync` [bad-argument-type]
+ ERROR src/anyio/_core/_fileio.py:480:41-58: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> bool` in function `anyio.to_thread.run_sync` [bad-argument-type]
- ERROR src/anyio/_core/_fileio.py:522:41-57: Argument `(self: Path, *, follow_symlinks: bool = True) -> str` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `anyio.to_thread.run_sync` [bad-argument-type]
+ ERROR src/anyio/_core/_fileio.py:522:41-57: Argument `(self: Path, *, follow_symlinks: bool = True) -> str` is not assignable to parameter `func` with type `(**tuple[*@_]) -> str` in function `anyio.to_thread.run_sync` [bad-argument-type]
- ERROR src/anyio/_core/_fileio.py:551:41-58: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `anyio.to_thread.run_sync` [bad-argument-type]
+ ERROR src/anyio/_core/_fileio.py:551:41-58: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> bool` in function `anyio.to_thread.run_sync` [bad-argument-type]
- ERROR src/anyio/_core/_fileio.py:557:41-59: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `anyio.to_thread.run_sync` [bad-argument-type]
+ ERROR src/anyio/_core/_fileio.py:557:41-59: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> bool` in function `anyio.to_thread.run_sync` [bad-argument-type]
- ERROR src/anyio/_core/_fileio.py:637:41-57: Argument `(self: Path, *, follow_symlinks: bool = True) -> str` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `anyio.to_thread.run_sync` [bad-argument-type]
+ ERROR src/anyio/_core/_fileio.py:637:41-57: Argument `(self: Path, *, follow_symlinks: bool = True) -> str` is not assignable to parameter `func` with type `(**tuple[*@_]) -> str` in function `anyio.to_thread.run_sync` [bad-argument-type]
- ERROR src/anyio/from_thread.py:91:9-13: Argument `(**tuple[*PosArgsT]) -> Awaitable[T_Retval]` is not assignable to parameter `func` with type `(**tuple[*@_]) -> Awaitable[@_]` in function `anyio.abc._eventloop.AsyncBackend.run_async_from_thread` [bad-argument-type]
+ ERROR src/anyio/from_thread.py:91:9-13: Argument `(**tuple[*PosArgsT]) -> Awaitable[T_Retval]` is not assignable to parameter `func` with type `(**tuple[*@_]) -> Awaitable[T_Retval]` in function `anyio.abc._eventloop.AsyncBackend.run_async_from_thread` [bad-argument-type]
- ERROR src/anyio/from_thread.py:119:9-13: Argument `(**tuple[*PosArgsT]) -> T_Retval` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `anyio.abc._eventloop.AsyncBackend.run_sync_from_thread` [bad-argument-type]
+ ERROR src/anyio/from_thread.py:119:9-13: Argument `(**tuple[*PosArgsT]) -> T_Retval` is not assignable to parameter `func` with type `(**tuple[*@_]) -> T_Retval` in function `anyio.abc._eventloop.AsyncBackend.run_sync_from_thread` [bad-argument-type]
- ERROR src/anyio/from_thread.py:378:38-42: Argument `(**tuple[*PosArgsT]) -> Awaitable[T_Retval] | T_Retval` is not assignable to parameter `func` with type `(**tuple[*@_]) -> Awaitable[@_] | @_` in function `BlockingPortal._spawn_task_from_thread` [bad-argument-type]
+ ERROR src/anyio/from_thread.py:378:38-42: Argument `(**tuple[*PosArgsT]) -> Awaitable[T_Retval] | T_Retval` is not assignable to parameter `func` with type `(**tuple[*@_]) -> Awaitable[T_Retval] | T_Retval` in function `BlockingPortal._spawn_task_from_thread` [bad-argument-type]
- ERROR src/anyio/to_thread.py:64:9-13: Argument `(**tuple[*PosArgsT]) -> T_Retval` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `anyio.abc._eventloop.AsyncBackend.run_sync_in_worker_thread` [bad-argument-type]
+ ERROR src/anyio/to_thread.py:64:9-13: Argument `(**tuple[*PosArgsT]) -> T_Retval` is not assignable to parameter `func` with type `(**tuple[*@_]) -> T_Retval` in function `anyio.abc._eventloop.AsyncBackend.run_sync_in_worker_thread` [bad-argument-type]
Tanjun (https://github.com/FasterSpeeding/Tanjun)
- ERROR tanjun/checks.py:598:12-602:6: Returned type `((ExecutableCommand[Any]) -> ExecutableCommand[Any]) | ExecutableCommand[Any]` is not assignable to declared return type `((_CommandT) -> _CommandT) | _CommandT` [bad-return]
- ERROR tanjun/checks.py:660:12-664:6: Returned type `((ExecutableCommand[Any]) -> ExecutableCommand[Any]) | ExecutableCommand[Any]` is not assignable to declared return type `((_CommandT) -> _CommandT) | _CommandT` [bad-return]
- ERROR tanjun/checks.py:722:12-726:6: Returned type `((ExecutableCommand[Any]) -> ExecutableCommand[Any]) | ExecutableCommand[Any]` is not assignable to declared return type `((_CommandT) -> _CommandT) | _CommandT` [bad-return]
- ERROR tanjun/checks.py:784:12-788:6: Returned type `((ExecutableCommand[Any]) -> ExecutableCommand[Any]) | ExecutableCommand[Any]` is not assignable to declared return type `((_CommandT) -> _CommandT) | _CommandT` [bad-return]
- ERROR tanjun/checks.py:846:12-850:6: Returned type `((ExecutableCommand[Any]) -> ExecutableCommand[Any]) | ExecutableCommand[Any]` is not assignable to declared return type `((_CommandT) -> _CommandT) | _CommandT` [bad-return]
- ERROR tanjun/components.py:864:16-98: Returned type `((ExecutableCommand[Any]) -> ExecutableCommand[Any]) | ExecutableCommand[Any]` is not assignable to declared return type `((_CommandT) -> _CommandT) | _CommandT` [bad-return]
- ERROR tanjun/components.py:900:16-72: Returned type `((MenuCommand[Any, Any]) -> MenuCommand[Any, Any]) | MenuCommand[Any, Any]` is not assignable to declared return type `((_MenuCommandT) -> _MenuCommandT) | _MenuCommandT` [bad-return]
- ERROR tanjun/components.py:937:16-73: Returned type `((BaseSlashCommand) -> BaseSlashCommand) | BaseSlashCommand` is not assignable to declared return type `((_BaseSlashCommandT) -> _BaseSlashCommandT) | _BaseSlashCommandT` [bad-return]
- ERROR tanjun/components.py:983:16-75: Returned type `((MessageCommand[Any]) -> MessageCommand[Any]) | MessageCommand[Any]` is not assignable to declared return type `((_MessageCommandT) -> _MessageCommandT) | _MessageCommandT` [bad-return]
bokeh (https://github.com/bokeh/bokeh)
- ERROR src/bokeh/core/property/container.py:255:9-25: Class member `ColumnData.make_descriptors` overrides parent class `Dict` in an inconsistent manner [bad-param-name-override]
+ ERROR src/bokeh/core/property/container.py:255:9-25: Class member `ColumnData.make_descriptors` overrides parent class `Dict` in an inconsistent manner [bad-override]
- ERROR src/bokeh/core/property/dataspec.py:218:9-25: Class member `DataSpec.make_descriptors` overrides parent class `Either` in an inconsistent manner [bad-param-name-override]
+ ERROR src/bokeh/core/property/dataspec.py:218:9-25: Class member `DataSpec.make_descriptors` overrides parent class `Either` in an inconsistent manner [bad-override]
+ ERROR src/bokeh/layouts.py:575:34-68: Argument `list[LayoutDOM | grid.col | grid.row]` is not assignable to parameter `children` with type `list[grid.col | grid.row]` in function `col.__init__` [bad-argument-type]
+ ERROR src/bokeh/layouts.py:575:34-68: Argument `list[LayoutDOM | grid.col | grid.row]` is not assignable to parameter `children` with type `list[grid.col | grid.row]` in function `row.__init__` [bad-argument-type]
- ERROR src/bokeh/layouts.py:575:43-51: Argument `((children: list[LayoutDOM], level: int = 0) -> grid.col | grid.row) | ((item: LayoutDOM, top_level: bool = False) -> LayoutDOM | grid.col | grid.row)` is not assignable to parameter `func` with type `(list[LayoutDOM]) -> grid.col | grid.row` in function `map.__new__` [bad-argument-type]
+ ERROR src/bokeh/layouts.py:575:43-51: Argument `((children: list[LayoutDOM], level: int = 0) -> grid.col | grid.row) | ((item: LayoutDOM, top_level: bool = False) -> LayoutDOM | grid.col | grid.row)` is not assignable to parameter `func` with type `(list[LayoutDOM]) -> LayoutDOM | grid.col | grid.row` in function `map.__new__` [bad-argument-type]
asynq (https://github.com/quora/asynq)
- ERROR asynq/debug.py:147:9-24: Class member `AsynqStackTracebackFormatter.formatException` overrides parent class `Formatter` in an inconsistent manner [bad-param-name-override]
+ ERROR asynq/debug.py:147:9-24: Class member `AsynqStackTracebackFormatter.formatException` overrides parent class `Formatter` in an inconsistent manner [bad-override]
streamlit (https://github.com/streamlit/streamlit)
- ERROR lib/streamlit/runtime/fragment.py:443:12-48: Returned type `(((...) -> Any) -> (...) -> Any) | ((...) -> Any)` is not assignable to declared return type `((F) -> F) | F` [bad-return]
Expression (https://github.com/cognitedata/Expression)
- ERROR expression/collections/block.py:268:30-37: Argument `(**tuple[*_P]) -> _TResult` is not assignable to parameter `mapper` with type `(**tuple[*@_]) -> @_` in function `starmap` [bad-argument-type]
+ ERROR expression/collections/block.py:268:30-37: Argument `(**tuple[*_P]) -> _TResult` is not assignable to parameter `mapper` with type `(**tuple[*@_]) -> _TResult` in function `starmap` [bad-argument-type]
- ERROR expression/core/option.py:449:27-33: Argument `(**tuple[*_P]) -> _TResult` is not assignable to parameter `mapper` with type `(**tuple[*_P]) -> @_` in function `Option.starmap` [bad-argument-type]
+ ERROR expression/core/option.py:449:27-33: Argument `(**tuple[*_P]) -> _TResult` is not assignable to parameter `mapper` with type `(**tuple[*_P]) -> _TResult` in function `Option.starmap` [bad-argument-type]
- ERROR tests/test_array.py:47:36-50: Argument `(TypedArray[object]) -> TypedArray[str]` is not assignable to parameter `fn1` with type `(TypedArray[int]) -> @_` in function `expression.core.pipe.pipe` [bad-argument-type]
+ ERROR tests/test_array.py:47:36-50: Argument `(TypedArray[object]) -> TypedArray[str]` is not assignable to parameter `fn1` with type `(TypedArray[int]) -> TypedArray[str]` in function `expression.core.pipe.pipe` [bad-argument-type]
freqtrade (https://github.com/freqtrade/freqtrade)
+ ERROR freqtrade/data/metrics.py:333:12-40: Returned type `tuple[Series[float] | Series | float, Series[float] | Series | float]` is not assignable to declared return type `tuple[float, float]` [bad-return]
+ ERROR freqtrade/data/metrics.py:411:20-65: `/` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/data/metrics.py:434:12-24: Returned type `Literal[-100] | Series | Unknown` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/freqtradebot.py:844:26-48: `/` is not supported between `Series[str]` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/freqtradebot.py:844:26-48: `/` is not supported between `Series[str]` and `Series` [unsupported-operation]
+ ERROR freqtrade/freqtradebot.py:844:26-48: `/` is not supported between `Series` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_max_drawdown.py:44:20-33: Returned type `Series[str] | Series` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_max_drawdown.py:45:16-57: `/` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_max_drawdown.py:45:16-57: Returned type `Series | Unknown` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_max_drawdown_relative.py:40:24-37: Returned type `Series[str] | Series` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_max_drawdown_relative.py:43:20-33: Returned type `Series[str] | Series` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py:67:25-69: `/` is not supported between `Series[str]` and `Series` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py:94:32-96:10: `-` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py:94:48-88: `*` is not supported between `Literal[0]` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_multi_metric.py:94:48-88: `*` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_onlyprofit.py:26:16-33: `*` is not supported between `Literal[-1]` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_onlyprofit.py:26:16-33: Returned type `Series | int` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py:36:16-38:10: Returned type `Series | Unknown` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py:37:13-92: `-` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py:37:29-69: `*` is not supported between `Literal[0]` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_profit_drawdown.py:37:29-69: `*` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_short_trade_dur.py:49:34-68: `/` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/optimize/hyperopt_loss/hyperopt_loss_short_trade_dur.py:52:16-22: Returned type `Series | Unknown` is not assignable to declared return type `float` [bad-return]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:87:20-65: `/` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:89:21-66: `+` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:93:21-56: `/` is not supported between `Series[str]` and `Series` [unsupported-operation]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:128:65-78: Argument `Series | float` is not assignable to parameter `final_balance` with type `float` in function `freqtrade.data.metrics.calculate_cagr` [bad-argument-type]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:273:21-56: `/` is not supported between `Series[str]` and `Series` [unsupported-operation]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:560:21-56: `/` is not supported between `Series[str]` and `Series` [unsupported-operation]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:582:25-68: `/` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/optimize/optimize_reports/optimize_reports.py:583:30-99: `/` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/rpc/rpc.py:1523:45-55: Argument `Series[str] | Series | int` is not assignable to parameter `x` with type `Buffer | SupportsIndex | SupportsInt | SupportsTrunc | str` in function `int.__new__` [bad-argument-type]
+ ERROR freqtrade/templates/sample_hyperopt_loss.py:54:34-68: `/` is not supported between `Series[str]` and `float` [unsupported-operation]
+ ERROR freqtrade/templates/sample_hyperopt_loss.py:57:16-22: Returned type `Series | Unknown` is not assignable to declared return type `float` [bad-return]
more-itertools (https://github.com/more-itertools/more-itertools)
- ERROR more_itertools/more.py:950:22-25: Argument `type[map]` is not assignable to parameter `func` with type `((Any) -> Unknown, Iterable[Any], Iterable[Any]) -> @_` in function `map.__new__` [bad-argument-type]
+ ERROR more_itertools/more.py:950:22-25: Argument `type[map]` is not assignable to parameter `func` with type `((Any) -> Unknown, Iterable[Any], Iterable[Any]) -> map[Unknown]` in function `map.__new__` [bad-argument-type]
setuptools (https://github.com/pypa/setuptools)
- ERROR setuptools/_vendor/more_itertools/more.py:917:22-25: Argument `type[map]` is not assignable to parameter `func` with type `((Any) -> Unknown, Iterable[Any], Iterable[Any]) -> @_` in function `map.__new__` [bad-argument-type]
+ ERROR setuptools/_vendor/more_itertools/more.py:917:22-25: Argument `type[map]` is not assignable to parameter `func` with type `((Any) -> Unknown, Iterable[Any], Iterable[Any]) -> map[Unknown]` in function `map.__new__` [bad-argument-type]
pwndbg (https://github.com/pwndbg/pwndbg)
- ERROR pwndbg/aglib/disasm/aarch64.py:485:9-25: Class member `AArch64DisassemblyAssistant._parse_immediate` overrides parent class `DisassemblyAssistant` in an inconsistent manner [bad-param-name-override]
+ ERROR pwndbg/aglib/disasm/aarch64.py:485:9-25: Class member `AArch64DisassemblyAssistant._parse_immediate` overrides parent class `DisassemblyAssistant` in an inconsistent manner [bad-override]
- ERROR pwndbg/commands/onegadget.py:27:1-63: Argument `(((show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None) -> (show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None) | ((show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None)` is not assignable to parameter with type `((show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None) -> (show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None` [bad-argument-type]
+ ERROR pwndbg/commands/onegadget.py:27:1-63: Argument `(((show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None) -> (show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None) | ((show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None)` is not assignable to parameter with type `((show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None) -> ((show_unsat: bool = False, no_unknown: bool = False, verbose: bool = False) -> None) | None` [bad-argument-type]
django-stubs (https://github.com/typeddjango/django-stubs)
- ERROR django-stubs/db/models/fields/json.pyi:35:9-22: Class member `JSONField.get_transform` overrides parent class `Field` in an inconsistent manner [bad-param-name-override]
+ ERROR django-stubs/db/models/fields/json.pyi:35:9-22: Class member `JSONField.get_transform` overrides parent class `Field` in an inconsistent manner [bad-override]
schemathesis (https://github.com/schemathesis/schemathesis)
- ERROR src/schemathesis/auths.py:343:31-104: Argument `SelectiveAuthProvider[@_]` is not assignable to parameter `object` with type `AuthProvider[Unknown]` in function `list.append` [bad-argument-type]
+ ERROR src/schemathesis/auths.py:343:31-104: Argument `SelectiveAuthProvider[Unknown | None]` is not assignable to parameter `object` with type `AuthProvider[Unknown]` in function `list.append` [bad-argument-type]
- ERROR src/schemathesis/auths.py:343:62-80: Argument `RequestsAuth[@_]` is not assignable to parameter `provider` with type `AuthProvider[Unknown]` in function `SelectiveAuthProvider.__init__` [bad-argument-type]
+ ERROR src/schemathesis/auths.py:343:62-80: Argument `RequestsAuth[Unknown | None]` is not assignable to parameter `provider` with type `AuthProvider[Unknown]` in function `SelectiveAuthProvider.__init__` [bad-argument-type]
- ERROR src/schemathesis/auths.py:371:28-92: `CachingAuthProvider[@_]` is not assignable to variable `provider` with type `AuthProvider[Unknown]` [bad-assignment]
+ ERROR src/schemathesis/auths.py:371:28-92: `CachingAuthProvider[Unknown | None]` is not assignable to variable `provider` with type `AuthProvider[Unknown]` [bad-assignment]
- ERROR src/schemathesis/auths.py:373:28-375:18: `KeyedCachingAuthProvider[@_]` is not assignable to variable `provider` with type `AuthProvider[Unknown]` [bad-assignment]
+ ERROR src/schemathesis/auths.py:373:28-375:18: `KeyedCachingAuthProvider[Unknown | None]` is not assignable to variable `provider` with type `AuthProvider[Unknown]` [bad-assignment]
- ERROR src/schemathesis/auths.py:380:24-67: `SelectiveAuthProvider[@_]` is not assignable to variable `provider` with type `AuthProvider[Unknown]` [bad-assignment]
+ ERROR src/schemathesis/auths.py:380:24-67: `SelectiveAuthProvider[Unknown | None]` is not assignable to variable `provider` with type `AuthProvider[Unknown]` [bad-assignment]
- ERROR src/schemathesis/specs/openapi/adapter/parameters.py:1139:45-60: Argument `(value: dict[str, Any]) -> dict[str, Any]` is not assignable to parameter `pack` with type `(GeneratedValue) -> @_` in function `hypothesis.strategies._internal.strategies.SearchStrategy.map` [bad-argument-type]
+ ERROR src/schemathesis/specs/openapi/adapter/parameters.py:1139:45-60: Argument `(value: dict[str, Any]) -> dict[str, Any]` is not assignable to parameter `pack` with type `(GeneratedValue) -> dict[str, Any]` in function `hypothesis.strategies._internal.strategies.SearchStrategy.map` [bad-argument-type]
- ERROR src/schemathesis/specs/openapi/adapter/parameters.py:1152:45-74: Argument `(value: dict[str, Any]) -> dict[str, Any]` is not assignable to parameter `pack` with type `(GeneratedValue) -> @_` in function `hypothesis.strategies._internal.strategies.SearchStrategy.map` [bad-argument-type]
+ ERROR src/schemathesis/specs/openapi/adapter/parameters.py:1152:45-74: Argument `(value: dict[str, Any]) -> dict[str, Any]` is not assignable to parameter `pack` with type `(GeneratedValue) -> dict[str, Any]` in function `hypothesis.strategies._internal.strategies.SearchStrategy.map` [bad-argument-type]
- ERROR src/schemathesis/specs/openapi/adapter/security.py:340:16-349:10: Returned type `CachingAuthProvider[@_]` is not assignable to declared return type `AuthProvider[Unknown]` [bad-return]
+ ERROR src/schemathesis/specs/openapi/adapter/security.py:340:16-349:10: Returned type `CachingAuthProvider[Unknown | None]` is not assignable to declared return type `AuthProvider[Unknown]` [bad-return]
steam.py (https://github.com/Gobot1234/steam.py)
+ ERROR steam/ext/tf2/currency.py:91:18-45: Object of class `int` has no attribute `as_tuple` [missing-attribute]
pip (https://github.com/pypa/pip)
- ERROR src/pip/_vendor/rich/text.py:1285:16-27: Returned type `Literal[1] | SupportsIndex` is not assignable to declared return type `int` [bad-return]
tornado (https://github.com/tornadoweb/tornado)
- ERROR tornado/test/web_test.py:1651:17-28: Class member `MyStaticFileHandler.get_content` overrides parent class `StaticFileHandler` in an inconsistent manner [bad-param-name-override]
+ ERROR tornado/test/web_test.py:1651:17-28: Class member `MyStaticFileHandler.get_content` overrides parent class `StaticFileHandler` in an inconsistent manner [bad-override]
openlibrary (https://github.com/internetarchive/openlibrary)
- ERROR openlibrary/core/imports.py:144:24-34: Argument `type[ImportItem]` is not assignable to parameter `func` with type `(@_) -> @_` in function `map.__new__` [bad-argument-type]
+ ERROR openlibrary/core/imports.py:144:24-34: Argument `type[ImportItem]` is not assignable to parameter `func` with type `(@_) -> ImportItem` in function `map.__new__` [bad-argument-type]
egglog-python (https://github.com/egraphs-good/egglog-python)
- ERROR python/egglog/thunk.py:50:20-49: Argument `Unresolved[@_, *TS]` is not assignable to parameter `state` with type `Error | Resolved[@_] | Resolving | Unresolved[@_, *TS]` in function `Thunk.__init__` [bad-argument-type]
+ ERROR python/egglog/thunk.py:50:20-49: Argument `Unresolved[T, *TS]` is not assignable to parameter `state` with type `Error | Resolved[T] | Resolving | Unresolved[T, *TS]` in function `Thunk.__init__` [bad-argument-type]
- ERROR python/egglog/thunk.py:50:31-33: Argument `(**tuple[*TS]) -> T` is not assignable to parameter `fn` with type `(**tuple[*TS]) -> @_` in function `Unresolved.__init__` [bad-argument-type]
+ ERROR python/egglog/thunk.py:50:31-33: Argument `(**tuple[*TS]) -> T` is not assignable to parameter `fn` with type `(**tuple[*TS]) -> T` in function `Unresolved.__init__` [bad-argument-type]
antidote (https://github.com/Finistere/antidote)
- ERROR tests/core/test_inject.py:549:13-27: Argument `() -> object` is not assignable to parameter `__arg` with type `(Any, ParamSpec(@_)) -> @_` in function `antidote.core.Inject.method` [bad-argument-type]
+ ERROR tests/core/test_inject.py:549:13-27: Argument `() -> object` is not assignable to parameter `__arg` with type `(Any, ParamSpec(@_)) -> object` in function `antidote.core.Inject.method` [bad-argument-type]
cloud-init (https://github.com/canonical/cloud-init)
- ERROR cloudinit/sources/DataSourceEc2.py:426:9-30: Class member `DataSourceEc2.device_name_to_device` overrides parent class `DataSource` in an inconsistent manner [bad-param-name-override]
+ ERROR cloudinit/sources/DataSourceEc2.py:426:9-30: Class member `DataSourceEc2.device_name_to_device` overrides parent class `DataSource` in an inconsistent manner [bad-override]
aiohttp (https://github.com/aio-libs/aiohttp)
- ERROR aiohttp/cookiejar.py:410:37-80: No matching overload found for function `itertools.accumulate.__new__` called with arguments: (type[accumulate[_T]], list[str], Overload[
- (self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString
- (self: LiteralString, *args: object, **kwargs: object) -> str
- ]) [no-matching-overload]
sockeye (https://github.com/awslabs/sockeye)
+ ERROR sockeye_contrib/plot_metrics.py:36:17-43:3: No matching overload found for function `typing.MutableMapping.update` called with arguments: (dict[str, Overload[[SupportsRichComparisonT: SupportsDunderGT[Any] | SupportsDunderLT[Any]](arg1: SupportsRichComparisonT, arg2: SupportsRichComparisonT, /, *_args: SupportsRichComparisonT, *, key: None = None) -> SupportsRichComparisonT, [_T](arg1: _T, arg2: _T, /, *_args: _T, *, key: (_T) -> SupportsRichComparison) -> _T, [SupportsRichComparisonT: SupportsDunderGT[Any] | SupportsDunderLT[Any]](iterable: Iterable[SupportsRichComparisonT], /, *, key: None = None) -> SupportsRichComparisonT, [_T](iterable: Iterable[_T], /, *, key: (_T) -> SupportsRichComparison) -> _T, [SupportsRichComparisonT: SupportsDunderGT[Any] | SupportsDunderLT[Any], _T](iterable: Iterable[SupportsRichComparisonT], /, *, key: None = None, default: _T) -> SupportsRichComparisonT | _T, [_T1, _T2](iterable: Iterable[_T1], /, *, key: (_T1) -> SupportsRichComparison, default: _T2) -> _T1 | _T2]]) [no-matching-overload]
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ ERROR tests/series/test_agg.py:26:22-44: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:26:34-36: No matching overload found for function `pandas.core.series.Series.mean` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:27:22-46: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:27:36-38: No matching overload found for function `pandas.core.series.Series.median` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:28:22-43: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:28:33-35: No matching overload found for function `pandas.core.series.Series.std` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:29:22-43: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:29:33-35: No matching overload found for function `pandas.core.series.Series.var` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:34:22-44: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:34:34-36: No matching overload found for function `pandas.core.series.Series.mean` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:35:22-46: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:35:36-38: No matching overload found for function `pandas.core.series.Series.median` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:36:22-43: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:36:33-35: No matching overload found for function `pandas.core.series.Series.std` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:37:22-43: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:37:33-35: No matching overload found for function `pandas.core.series.Series.var` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:42:22-44: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:42:34-36: No matching overload found for function `pandas.core.series.Series.mean` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:43:22-46: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:43:36-38: No matching overload found for function `pandas.core.series.Series.median` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:44:22-43: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:44:33-35: No matching overload found for function `pandas.core.series.Series.std` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:45:22-43: assert_type(Unknown, float) failed [assert-type]
+ ERROR tests/series/test_agg.py:45:33-35: No matching overload found for function `pandas.core.series.Series.var` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:52:22-46: assert_type(Unknown, complex) failed [assert-type]
+ ERROR tests/series/test_agg.py:52:34-36: No matching overload found for function `pandas.core.series.Series.mean` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:97:22-51: assert_type(Unknown, Timedelta) failed [assert-type]
+ ERROR tests/series/test_agg.py:97:34-36: No matching overload found for function `pandas.core.series.Series.mean` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:98:22-53: assert_type(Unknown, Timedelta) failed [assert-type]
+ ERROR tests/series/test_agg.py:98:36-38: No matching overload found for function `pandas.core.series.Series.median` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_agg.py:99:22-50: assert_type(Unknown, Timedelta) failed [assert-type]
+ ERROR tests/series/test_agg.py:99:33-35: No matching overload found for function `pandas.core.series.Series.std` called with arguments: () [no-matching-overload]
+ ERROR tests/series/test_cumul.py:35:20-60: assert_type(Series[Series | complex], Series[complex]) failed [assert-type]
bandersnatch (https://github.com/pypa/bandersnatch)
- ERROR src/bandersnatch/mirror.py:814:70-81: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `asyncio.events.AbstractEventLoop.run_in_executor` [bad-argument-type]
+ ERROR src/bandersnatch/mirror.py:814:70-81: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `func` with type `(**tuple[*@_]) -> bool` in function `asyncio.events.AbstractEventLoop.run_in_executor` [bad-argument-type]
hydpy (https://github.com/hydpy-dev/hydpy)
+ ERROR hydpy/core/seriestools.py:326:31-36: Argument `Index` is not assignable to parameter `date` with type `Date | datetime | str` in function `hydpy.core.timetools.Date.__new__` [bad-argument-type]
pandas (https://github.com/pandas-dev/pandas)
- ERROR pandas/core/arrays/string_arrow.py:282:9-29: Class member `ArrowStringArray._convert_bool_result` overrides parent class `ArrowExtensionArray` in an inconsistent manner [bad-param-name-override]
+ ERROR pandas/core/arrays/string_arrow.py:282:9-29: Class member `ArrowStringArray._convert_bool_result` overrides parent class `ArrowExtensionArray` in an inconsistent manner [bad-override]
- ERROR pandas/core/computation/align.py:86:12-19: Returned type `(terms: Unknown) -> tuple[partial[Unknown] | type[NDFrame], dict[str, Index] | None] | tuple[Unknown, None] | Unknown` is not assignable to declared return type `(F) -> F` [bad-return]
+ ERROR pandas/core/computation/align.py:86:12-19: Returned type `(terms: Unknown) -> tuple[dtype | Unknown, None] | tuple[partial[Unknown] | type[NDFrame], dict[str, Index] | None] | Unknown` is not assignable to declared return type `(F) -> F` [bad-return]
- ERROR pandas/core/computation/common.py:46:36-60: No matching overload found for function `pandas.core.dtypes.cast.find_common_type` called with arguments: (list[_Buffer | _HasDType[dtype] | _HasNumPyDType[dtype] | _NestedSequence[bytes | complex | str] | _NestedSequence[_SupportsArray[dtype]] | _SupportsArray[dtype] | bytes | complex | dtype | list[Any] | str | _DTypeDict | tuple[Any, Any] | type[Any] | Unknown | None]) [no-matching-overload]
- ERROR pandas/core/computation/expr.py:172:9-173:41: Argument `Generator[object]` is not assignable to parameter `iterable` with type `Iterable[_Token]` in function `tokenize.untokenize` [bad-argument-type]
+ ERROR pandas/core/computation/expr.py:172:9-173:41: Argument `Generator[object | Unknown]` is not assignable to parameter `iterable` with type `Iterable[_Token]` in function `tokenize.untokenize` [bad-argument-type]
+ ERROR pandas/core/computation/ops.py:266:27-28: Argument `type[bool] | dtype | Unknown` is not assignable to parameter `cls` with type `type` in function `issubclass` [bad-argument-type]
pytest-robotframework (https://github.com/detachhead/pytest-robotframework)
- ERROR tests/type_tests.py:64:5-40: Argument `() -> None` is not assignable to parameter `fn` with type `() -> AbstractContextManager[@_]` in function `pytest_robotframework._WrappedContextManagerKeywordDecorator.__call__` [bad-argument-type]
+ ERROR tests/type_tests.py:64:5-40: Argument `() -> None` is not assignable to parameter `fn` with type `(ParamSpec(@_)) -> AbstractContextManager[@_]` in function `pytest_robotframework._WrappedContextManagerKeywordDecorator.__call__` [bad-argument-type]
mypy (https://github.com/python/mypy)
- ERROR mypy/typeshed/stdlib/builtins.pyi:227:5-17: Argument `(metacls: Self@type, name: str, bases: tuple[type[Any], ...], /, **kwds: Any) -> MutableMapping[str, object]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:227:5-17: Argument `(metacls: Self@type, name: str, bases: tuple[type[Any], ...], /, **kwds: Any) -> MutableMapping[str, object]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> MutableMapping[str, object]` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:277:9-21: Argument `(cls: Self@int, bytes: Buffer | Iterable[SupportsIndex] | SupportsBytes, byteorder: Literal['big', 'little'] = 'big', *, signed: bool = False) -> Self@int` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:277:9-21: Argument `(cls: Self@int, bytes: Buffer | Iterable[SupportsIndex] | SupportsBytes, byteorder: Literal['big', 'little'] = 'big', *, signed: bool = False) -> Self@int` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> Self@int` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:370:5-17: Argument `(cls: Self@float, string: str, /) -> Self@float` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:370:5-17: Argument `(cls: Self@float, string: str, /) -> Self@float` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> Self@float` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:640:9-21: Argument `(cls: Self@bytes, string: str, /) -> Self@bytes` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:640:9-21: Argument `(cls: Self@bytes, string: str, /) -> Self@bytes` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> Self@bytes` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:750:9-21: Argument `(cls: Self@bytearray, string: str, /) -> Self@bytearray` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:750:9-21: Argument `(cls: Self@bytearray, string: str, /) -> Self@bytearray` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> Self@bytearray` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:1117:5-17: Argument `(cls: Self@mypy.typeshed.stdlib.builtins.dict, iterable: Iterable[_T], value: None = None, /) -> builtins.dict[_T, Any | None]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:1117:5-17: Argument `(cls: Self@mypy.typeshed.stdlib.builtins.dict, iterable: Iterable[_T], value: None = None, /) -> builtins.dict[_T, Any | None]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> builtins.dict[_T, Any | None]` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:1119:9-17: `fromkeys` has type `classmethod[Unknown, Ellipsis, Unknown]` after decorator application, which is not callable [invalid-overload]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:1119:9-17: `fromkeys` has type `classmethod[Unknown, Ellipsis, dict[_T, Any | None]]` after decorator application, which is not callable [invalid-overload]
- ERROR mypy/typeshed/stdlib/builtins.pyi:1120:5-17: Argument `(cls: Self@mypy.typeshed.stdlib.builtins.dict, iterable: Iterable[_T], value: _S, /) -> builtins.dict[_T, _S]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> @_` in function `classmethod.__init__` [bad-argument-type]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:1120:5-17: Argument `(cls: Self@mypy.typeshed.stdlib.builtins.dict, iterable: Iterable[_T], value: _S, /) -> builtins.dict[_T, _S]` is not assignable to parameter `f` with type `(type[@_], ParamSpec(@_)) -> builtins.dict[_T, _S]` in function `classmethod.__init__` [bad-argument-type]
- ERROR mypy/typeshed/stdlib/builtins.pyi:1122:9-17: `fromkeys` has type `classmethod[@_, @_, @_]` after decorator application, which is not callable [invalid-overload]
+ ERROR mypy/typeshed/stdlib/builtins.pyi:1122:9-17: `fromkeys` has type `classmethod[@_, @_, dict[_T, _S]]` after decorator application, which is not callable [invalid-overload]
+ ERROR mypy/typeshed/stdlib/collections/__init__.pyi:392:9-15: Class member `OrderedDict.__or__` overrides parent class `dict` in an inconsistent manner [bad-override]
+ ERROR mypy/typeshed/stdlib/collections/__init__.pyi:396:9-16: Class member `OrderedDict.__ror__` overrides parent class `dict` in an inconsistent manner [bad-override]
+ ERROR mypy/typeshed/stdlib/collections/__init__.pyi:440:9-15: Class member `defaultdict.__or__` overrides parent class `dict` in an inconsistent manner [bad-override]
+ ERROR mypy/typeshed/stdlib/collections/__init__.pyi:444:9-16: Class member `defaultdict.__ror__` overrides parent class `dict` in an inconsistent manner [bad-override]
meson (https://github.com/mesonbuild/meson)
- ERROR mesonbuild/ast/interpreter.py:338:9-31: Class member `AstInterpreter.evaluate_dictstatement` overrides parent class `InterpreterBase` in an inconsistent manner [bad-param-name-override]
+ ERROR mesonbuild/ast/interpreter.py:338:9-31: Class member `AstInterpreter.evaluate_dictstatement` overrides parent class `InterpreterBase` in an inconsistent manner [bad-override]
+ ERROR unittests/linuxliketests.py:727:62-77: Argument `[_StrOrBytesPathT: PathLike[bytes] | PathLike[str] | bytes | str](src: StrOrBytesPath, dst: _StrOrBytesPathT, *, follow_symlinks: bool = True) -> _StrOrBytesPathT` is not assignable to parameter `copy_function` with type `(str, str) -> object` in function `shutil.copytree` [bad-argument-type]
werkzeug (https://github.com/pallets/werkzeug)
- ERROR tests/test_utils.py:285:5-27: Argument `() -> Literal[42]` is not assignable to parameter `fget` with type `(Any) -> @_` in function `werkzeug.utils.cached_property.__init__` [bad-argument-type]
+ ERROR tests/test_utils.py:285:5-27: Argument `() -> Literal[42]` is not assignable to parameter `fget` with type `(Any) -> int` in function `werkzeug.utils.cached_property.__init__` [bad-argument-type]
rich (https://github.com/Textualize/rich)
- ERROR rich/text.py:1287:16-27: Returned type `Literal[1] | SupportsIndex` is not assignable to declared return type `int` [bad-return]
core (https://github.com/home-assistant/core)
- ERROR homeassistant/components/backup/backup.py:101:56-74: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `target` with type `(**tuple[*@_]) -> @_` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
+ ERROR homeassistant/components/backup/backup.py:101:56-74: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `target` with type `(**tuple[*@_]) -> bool` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
- ERROR homeassistant/components/image_upload/__init__.py:223:54-73: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `target` with type `(**tuple[*@_]) -> @_` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
+ ERROR homeassistant/components/image_upload/__init__.py:223:54-73: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `target` with type `(**tuple[*@_]) -> bool` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
- ERROR homeassistant/components/media_source/local_source.py:305:49-67: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `target` with type `(**tuple[*@_]) -> @_` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
+ ERROR homeassistant/components/media_source/local_source.py:305:49-67: Argument `(self: Path, *, follow_symlinks: bool = True) -> bool` is not assignable to parameter `target` with type `(**tuple[*@_]) -> bool` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
- ERROR homeassistant/components/panasonic_viera/__init__.py:251:62-66: Argument `(**tuple[*_Ts]) -> _R` is not assignable to parameter `target` with type `(**tuple[*@_]) -> @_` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
+ ERROR homeassistant/components/panasonic_viera/__init__.py:251:62-66: Argument `(**tuple[*_Ts]) -> _R` is not assignable to parameter `target` with type `(**tuple[*@_]) -> _R` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
- ERROR homeassistant/components/rfxtrx/entity.py:123:48-51: Argument `(**tuple[Unknown, *_Ts]) -> None` is not assignable to parameter `target` with type `(**tuple[*@_]) -> @_` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
+ ERROR homeassistant/components/rfxtrx/entity.py:123:48-51: Argument `(**tuple[Unknown, *_Ts]) -> None` is not assignable to parameter `target` with type `(**tuple[*@_]) -> None` in function `homeassistant.core.HomeAssistant.async_add_executor_job` [bad-argument-type]
- ERROR homeassistant/core.py:842:48-54: Argument `(**tuple[*_Ts]) -> _T` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `asyncio.events.AbstractEventLoop.run_in_executor` [bad-argument-type]
+ ERROR homeassistant/core.py:842:48-54: Argument `(**tuple[*_Ts]) -> _T` is not assignable to parameter `func` with type `(**tuple[*@_]) -> _T` in function `asyncio.events.AbstractEventLoop.run_in_executor` [bad-argument-type]
- ERROR homeassistant/core.py:859:64-70: Argument `(**tuple[*_Ts]) -> _T` is not assignable to parameter `func` with type `(**tuple[*@_]) -> @_` in function `asyncio.events.AbstractEventLoop.run_in_executor` [bad-argument-type]
+ ERROR homeassistant/core.py:859:64-70: Argument `(**tuple[*_Ts]) -> _T` is not assignable to parameter `func` with type `(**tuple[*@_]) -> _T` in function `asyncio.events.AbstractEventLoop.run_in_executor` [bad-argument-type]
- ERROR homeassistant/loader.py:1504:15-17: Argument `dict[@_, @_]` is not assignable to parameter `cache` with type `_ResolveDependenciesCacheProtocol` in function `_resolve_integrations_dependencies` [bad-argument-type]
+ ERROR homeassistant/loader.py:1504:15-17: Argument `dict[@_, Exception | set[str] | None]` is not assignable to parameter `cache` with type `_ResolveDependenciesCacheProtocol` in function `_resolve_integrations_dependencies` [bad-argument-type]
trio (https://github.com/python-trio/trio)
- ERROR src/trio/_tests/test_signals.py:73:38-57: Unpacked argument `tuple[() -> Coroutine[Unknown, Unknown, None]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[@_], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
+ ERROR src/trio/_tests/test_signals.py:73:38-57: Unpacked argument `tuple[() -> Coroutine[Unknown, Unknown, None]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[Unknown | None], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
- ERROR src/trio/_tests/test_threads.py:921:44-86: Unpacked argument `tuple[() -> Task]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> @_, *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
+ ERROR src/trio/_tests/test_threads.py:921:44-86: Unpacked argument `tuple[() -> Task]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Task, *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
- ERROR src/trio/_tests/test_threads.py:922:44-81: Unpacked argument `tuple[() -> Coroutine[Unknown, Unknown, Task]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[@_], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
+ ERROR src/trio/_tests/test_threads.py:922:44-81: Unpacked argument `tuple[() -> Coroutine[Unknown, Unknown, Task]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[Task], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
- ERROR src/trio/_tests/test_threads.py:931:31-72: Unpacked argument `tuple[() -> int]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> @_, *Unknown]` in function `trio._threads.from_thread_run` [bad-argument-type]
- ERROR src/trio/_tests/test_threads.py:990:33-67: Unpacked argument `tuple[() -> Coroutine[Unknown, Unknown, None]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[@_], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
+ ERROR src/trio/_tests/test_threads.py:990:33-67: Unpacked argument `tuple[() -> Coroutine[Unknown, Unknown, None]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[Unknown | None], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
- ERROR src/trio/_tests/test_threads.py:1121:37-89: Unpacked argument `tuple[(seconds: float) -> Coroutine[Unknown, Unknown, None], Literal[0]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[@_], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
+ ERROR src/trio/_tests/test_threads.py:1121:37-89: Unpacked argument `tuple[(seconds: float) -> Coroutine[Unknown, Unknown, None], Literal[0]]` is not assignable to parameter `*args` with type `tuple[(**tuple[*Unknown]) -> Awaitable[Unknown | None], *Unknown]` in function `trio._threads.to_thread_run_sync` [bad-argument-type]
xarray (https://github.com/pydata/xarray)
- ERROR xarray/core/groupby.py:544:28-37: Object of class `bytes` has no attribute `data`
- Object of class `complex` has no attribute `data`
- Object of class `str` has no attribute `data` [missing-attribute]
- ERROR xarray/tests/test_dataset.py:574:57-73: Argument `Iterator[Any]` is not assignable to parameter `indexers` with type `Mapping[Any, Any] | None` in function `xarray.core.dataarray.DataArray.reindex` [bad-argument-type]
+ ERROR xarray/tests/test_dataset.py:574:57-73: Argument `Iterator[Index]` is not assignable to parameter `indexers` with type `Mapping[Any, Any] | None` in function `xarray.core.dataarray.DataArray.reindex` [bad-argument-type]
- ERROR xarray/tests/test_dataset.py:574:57-73: Argument `Iterator[Any]` is not assignable to parameter `labels` with type `ExtensionArray | Index | SequenceNotStr[Any] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.reindex` [bad-argument-type]
+ ERROR xarray/tests/test_dataset.py:574:57-73: Argument `Iterator[Index]` is not assignable to parameter `labels` with type `ExtensionArray | Index | SequenceNotStr[Any] | Series | ndarray | range | None` in function `pandas.core.frame.DataFrame.reindex` [bad-argument-type]
- ERROR xarray/tests/test_dataset.py:574:57-73: Argument `Iterator[Any]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Any] | Series | ndarray | range | None` in function `pandas.core.series.Series.reindex` [bad-argument-type]
+ ERROR xarray/tests/test_dataset.py:574:57-73: Argument `Iterator[Index]` is not assignable to parameter `index` with type `ExtensionArray | Index | SequenceNotStr[Any] | Series | ndarray | range | None` in function `pandas.core.series.Series.reindex` [bad-argument-type]
scrapy (https://github.com/scrapy/scrapy)
- ERROR tests/test_spidermiddleware_referer.py:685:9-17: Class member `CustomPythonOrgPolicy.referrer` overrides parent class `ReferrerPolicy` in an inconsistent manner [bad-param-name-override]
+ ERROR tests/test_spidermiddleware_referer.py:685:9-17: Class member `CustomPythonOrgPolicy.referrer` overrides parent class `ReferrerPolicy` in an inconsistent manner [bad-override]
spark (https://github.com/apache/spark)
+ ERROR python/pyspark/pandas/tests/computation/test_stats.py:204:47-49: No matching overload found for function `pandas.core.series.Series.mean` called with arguments: () [no-matching-overload]
+ ERROR python/pyspark/pandas/tests/computation/test_stats.py:206:45-47: No matching overload found for function `pandas.core.series.Series.var` called with arguments: () [no-matching-overload]
+ ERROR python/pyspark/pandas/tests/computation/test_stats.py:207:51-59: No matching overload found for function `pandas.core.series.Series.var` called with arguments: (ddof=Literal[0]) [no-matching-overload]
+ ERROR python/pyspark/pandas/tests/computation/test_stats.py:208:51-59: No matching overload found for function `pandas.core.series.Series.var` called with arguments: (ddof=Literal[2]) [no-matching-overload]
+ ERROR python/pyspark/pandas/tests/computation/test_stats.py:209:45-47: No matching overload found for function `pandas.core.series.Series.std` called with arguments: () [no-matching-overload]
+ ERROR python/pyspark/pandas/tests/computation/test_stats.py:210:51-59: No matching overload found for function `pandas.core.series.Series.std` called with arguments: (ddof=Literal[0]) [no-matching-overload]
+ ERROR python/pyspark/pandas/tests/computation/test_stats.py:211:51-59: No matching overload found for function `pandas.core.series.Series.std` called with arguments: (ddof=Literal[2]) [no-matching-overload]
+ ERROR python/pyspark/pandas/tests/series/test_compute.py:155:63-67: No matching overload found for function `pandas.core.series.Series.diff` called with arguments: (Literal[-1]) [no-matching-overload]
- ERROR python/pyspark/pandas/tests/series/test_cumulative.py:31:41-43: Argument `Series[float | None]` is not assignable to parameter `self` with type `SupportsGetItem[Scalar, _SupportsAdd[float]]` in function `pandas.core.series.Series.sum` [bad-argument-type]
+ ERROR python/pyspark/pandas/tests/series/test_cumulative.py:31:41-43: Argument `Series[float | None]` is not assignable to parameter `self` with type `SupportsGetItem[Scalar, _SupportsAdd[Series[str] | Series | float]]` in function `pandas.core.series.Series.sum` [bad-argument-type]
- ERROR python/pyspark/pandas/tests/series/test_cumulative.py:44:41-43: Argument `Series[float | None]` is not assignable to parameter `self` with type `SupportsGetItem[Scalar, _SupportsAdd[float]]` in function `pandas.core.series.Series.sum` [bad-argument-type]
+ ERROR python/pyspark/pandas/tests/series/test_cumulative.py:44:41-43: Argument `Series[float | None]` is not assignable to parameter `self` with type `SupportsGetItem[Scalar, _SupportsAdd[Series[str] | Series | float]]` in function `pandas.core.series.Series.sum` [bad-argument-type]
- ERROR python/pyspark/pandas/tests/series/test_cumulative.py:57:41-43: Argument `Series[float | None]` is not assignable to parameter `self` with type `SupportsGetItem[Scalar, _SupportsAdd[float]]` in function `pandas.core.series.Series.sum` [bad-argument-type]
+ ERROR python/pyspark/pandas/tests/series/test_cumulative.py:57:41-43: Argument `Series[float | None]` is not assignable to parameter `self` with type `SupportsGetItem[Scalar, _SupportsAdd[Series[str] | Series | float]]` in function `pandas.core.series.Series.sum` [bad-argument-type]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_grouped_map.py:1028:17-42: `+=` is not supported between `int` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_grouped_map.py:1046:17-42: `+=` is not supported between `int` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_grouped_map.py:1354:17-49: `+=` is not supported between `int` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_grouped_map.py:1455:17-42: `+=` is not supported between `int` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:551:17-38: `+=` is not supported between `int` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:552:20-25: Returned type `Series | int` is not assignable to declared return type `int` [bad-return]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:940:17-40: `+=` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:942:20-53: Returned type `Series | float` is not assignable to declared return type `float` [bad-return]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:972:17-41: `+=` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:973:20-64: Returned type `Series | float | Unknown` is not assignable to declared return type `float` [bad-return]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:997:17-38: `+=` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:998:20-25: Returned type `Series | float` is not assignable to declared return type `float` [bad-return]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:1006:17-33: `+=` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_grouped_agg.py:1007:20-25: Returned type `Series | float` is not assignable to declared return type `float` [bad-return]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py:397:17-40: `+=` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py:399:20-53: Returned type `Series | float` is not assignable to declared return type `float` [bad-return]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py:420:17-41: `+=` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/pandas/test_pandas_udf_typehints.py:421:20-64: Returned type `Series | float | Unknown` is not assignable to declared return type `float` [bad-return]
+ ERROR python/pyspark/sql/tests/test_udf_profiler.py:551:17-35: `+=` is not supported between `float` and `Series[str]` [unsupported-operation]
+ ERROR python/pyspark/sql/tests/test_udf_profiler.py:553:20-53: Returned type `Series | float` is not assignable to declared return type `float` [bad-return]
- ERROR python/pyspark/sql/types.py:2760:25-2768:26: Argument `Generator[DataType]` is not assignable to parameter `iterable` with type `Iterable[StructType]` in function `functools.reduce` [bad-argument-type]
attrs (https://github.com/python-attrs/attrs)
- ERROR tests/test_converters.py:25:23-26: Argument `type[int]` is not assignable to parameter `converter` with type `(ConvertibleToInt, AttrsInstance, Attribute[Unknown]) -> @_` in function `attr.Converter.__init__` [bad-argument-type]
+ ERROR tests/test_converters.py:25:23-26: Argument `type[int]` is not assignable to parameter `converter` with type `(ConvertibleToInt, AttrsInstance, Attribute[Unknown]) -> int` in function `attr.Converter.__init__` [bad-argument-type]
- ERROR tests/test_converters.py:104:23-30: Argument `(_: Unknown, __: Unknown, ___: Unknown) -> float` is not assignable to parameter `converter` with type `(Unknown) -> @_` in function `attr.Converter.__init__` [bad-argument-type]
+ ERROR tests/test_converters.py:104:23-30: Argument `(_: Unknown, __: Unknown, ___: Unknown) -> float` is not assignable to parameter `converter` with type `(Unknown) -> float` in function `attr.Converter.__init__` [bad-argument-type]
prefect (https://github.com/PrefectHQ/prefect)
- ERROR src/prefect/flows.py:2201:20-2222:14: Returned type `Flow[[(ParamSpec(P)) -> R], Coroutine[Any, Any, Unknown]]` is not assignable to declared return type `(((ParamSpec(P)) -> R) -> Flow[P, R]) | Flow[P, R]` [bad-return]
+ ERROR src/prefect/flows.py:2201:20-2222:14: Returned type `Flow[P, Coroutine[Any, Any, Unknown]]` is not assignable to declared return type `(((ParamSpec(P)) -> R) -> Flow[P, R]) | Flow[P, R]` [bad-return]
- ERROR src/prefect/flows.py:2202:20-24: Argument `(ParamSpec(P)) -> R` is not assignable to parameter `fn` with type `(((ParamSpec(P)) -> R) -> Coroutine[Any, Any, Unknown]) | classmethod[Any, [(ParamSpec(P)) -> R], Coroutine[Any, Any, Unknown]] | staticmethod[[(ParamSpec(P)) -> R], Coroutine[Any, Any, Unknown]]` in function `Flow.__init__` [bad-argument-type]
+ ERROR src/prefect/flows.py:2202:20-24: Argument `(ParamSpec(P)) -> R` is not assignable to parameter `fn` with type `((ParamSpec(P)) -> Coroutine[Any, Any, Unknown]) | classmethod[Any, P, Coroutine[Any, Any, Unknown]] | staticmethod[P, Coroutine[Any, Any, Unknown]]` in function `Flow.__init__` [bad-argument-type]
- ERROR src/prefect/server/database/_migrations/env.py:190:35-52: Argument `(connection: AsyncEngine) -> None` is not assignable to parameter with type `(Connection, ParamSpec(@_)) -> @_` in function `sqlalchemy.ext.asyncio.engine.AsyncConnection.run_sync` [bad-argument-type]
+ ERROR src/prefect/server/database/_migrations/env.py:190:35-52: Argument `(connection: AsyncEngine) -> None` is not assignable to parameter with type `(Connection, ParamSpec(@_)) -> None` in function `sqlalchemy.ext.asyncio.engine.AsyncConnection.run_sync` [bad-argument-type]
scipy-stubs (https://github.com/scipy/scipy-stubs)
+ ERROR tests/sparse/test_construct.pyi:291:12-130: assert_type(coo_array[_Numeric, tuple[int, int]] | coo_matrix, coo_array[floating[_32Bit], tuple[int, int]] | coo_matrix[floating[_32Bit]]) failed [assert-type]
jax (https://github.com/google/jax)
+ ERROR jax/_src/pallas/mosaic/interpret/interpret_pallas_call.py:2032:53-67: Argument `DynamicGridDim | int | Unknown` is not assignable to parameter `y` with type `Array | builtins.bool | numpy.bool | complex | float | int | ndarray | number` in function `jax.numpy.BinaryUfunc.__call__` [bad-argument-type]
|
Primer Diff Classification❌ 11 regression(s) | ✅ 6 improvement(s) | ➖ 20 neutral | ❓ 1 needs review | 38 project(s) total | +178, -90 errors 11 regression(s) across bokeh, asynq, steam.py, sockeye, pandas-stubs, hydpy, pytest-robotframework, mypy, meson, scipy-stubs, jax. error kinds:
Detailed analysis❌ Regression (11)bokeh (+4, -3)
asynq (+1, -1)
steam.py (+1)
sockeye (+1)
pandas-stubs (+33)
hydpy (+1)
pytest-robotframework (+1, -1)
mypy (+13, -9)
Per-category reasoning:
meson (+2, -1)
scipy-stubs (+1)
jax (+1)
✅ Improvement (6)Tanjun (-9)
Pyrefly was incorrectly reporting that
streamlit (-1)
freqtrade (+30)
The reordering of return-type-before-parameters in callable subtyping changed how type variables are resolved during pandas operator overload resolution, causing incorrect type inference for pandas arithmetic operations.
pip (-1)
rich (-1)
spark (+31, -4)
The analysis accurately describes the code behavior, type system facts, and the nature of the regressions.
➖ Neutral (20)anyio (+10, -10)
more-itertools (+1, -1)
setuptools (+1, -1)
pwndbg (+2, -2)
django-stubs (+1, -1)
schemathesis (+8, -8)
tornado (+1, -1)
openlibrary (+1, -1)
Both the old error (with However, the new error represents a genuine improvement: the return type is now correctly resolved to
egglog-python (+2, -2)
antidote (+1, -1)
cloud-init (+1, -1)
bandersnatch (+1, -1)
pandas (+4, -4)
Changed New Changed Removed Overall: 1 improvement (removed false positive), 1 minor regression (additional false positive in ops.py and slightly worse inference with Unknown), and 2 neutral changes (error code/message changes). The net effect is roughly neutral.
The tuple-related changes in werkzeug (+1, -1)
core (+8, -8)
trio (+5, -6)
xarray (+1, -1)
scrapy (+1, -1)
attrs (+2, -2)
prefect (+3, -3)
❓ Needs Review (1)Expression (+3, -3)
Suggested fixesSummary: The reordering of callable subtype checking (return types before parameters) in subset.rs fixes reduce(gcd,...) but causes widespread regressions in overload resolution, type variable solving, and callable compatibility checks across 11 projects, with 80+ pyrefly-only false positives. 1. In
Was this helpful? React with 👍 or 👎 Classification by primer-classifier (9 heuristic, 29 LLM) |
Summary
Fixes #2866
callable subtyping now checks return types before parameters.
That lets a target type variable pick up the precise covariant lower bound from math.gcd’s int return before the contravariant parameter check confirms it is still compatible with SupportsIndex, instead of prematurely pinning to SupportsIndex.
Test Plan