Skip to content

Conversation

@KotlinIsland
Copy link
Collaborator

@KotlinIsland KotlinIsland commented Sep 21, 2025

fixes: #1486

upstream typeshed: python/typeshed#14756

@KotlinIsland
Copy link
Collaborator Author

KotlinIsland commented Sep 21, 2025

test failure due to: #1491

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

tornado (https://github.com/tornadoweb/tornado)
+   .../projects/tornado/tornado/test/ioloop_test.py:778:9 - warning: Type of "stmt_list" is partially unknown
+     Type of "stmt_list" is "list[str | Unknown]" (reportUnknownVariableType)
+   .../projects/tornado/tornado/test/ioloop_test.py:782:49 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "iterable" in function "join"
+     Argument type is "list[str | Unknown]" (reportUnknownArgumentType)
-     Argument type is "Unknown | list[str]" (reportUnknownArgumentType)
+     Argument type is "Unknown | list[bytes | PathLike[bytes] | PathLike[str] | str | Unknown]" (reportUnknownArgumentType)
- 663 errors, 10168 warnings, 0 notes
+ 663 errors, 10170 warnings, 0 notes

ibis (https://github.com/ibis-project/ibis)
+   .../projects/ibis/ibis/backends/mssql/tests/test_client.py:91:1 - warning: Type of "DB_TYPES" is partially unknown
+     Type of "DB_TYPES" is "list[tuple[str, Int64] | tuple[str, Boolean] | tuple[str, Decimal] | tuple[str, Int32] | tuple[str, Int16] | tuple[str, UInt8] | tuple[str, Float32] | tuple[str, Float64] | tuple[str, Date] | tuple[str, Time] | tuple[str, Timestamp] | tuple[str, String] | tuple[str, Binary] | tuple[str, ModuleType] | tuple[str, GeoSpatial] | Unknown]" (reportUnknownVariableType)
-   .../projects/ibis/ibis/backends/sql/compilers/bigquery/__init__.py:306:47 - error: Argument of type "list[object | str]" cannot be assigned to parameter "iterable" of type "Iterable[str]" in function "join"
+   .../projects/ibis/ibis/backends/sql/compilers/bigquery/__init__.py:306:47 - error: Argument of type "list[str | object]" cannot be assigned to parameter "iterable" of type "Iterable[str]" in function "join"
-     "list[object | str]" is not assignable to "Iterable[str]"
+     "list[str | object]" is not assignable to "Iterable[str]"
-       Type parameter "_T_co@Iterable" is covariant, but "object | str" is not a subtype of "str"
+       Type parameter "_T_co@Iterable" is covariant, but "str | object" is not a subtype of "str"
-         Type "object | str" is not assignable to type "str"
+         Type "str | object" is not assignable to type "str"
-     Argument type is "list[Unknown]" (reportUnknownArgumentType)
+     Argument type is "list[Parameter | Unknown]" (reportUnknownArgumentType)
-     Argument type is "list[Unknown | Any]" (reportUnknownArgumentType)
+     Argument type is "list[Unknown | Any | str]" (reportUnknownArgumentType)
- 8387 errors, 109996 warnings, 0 notes
+ 8387 errors, 109997 warnings, 0 notes

sympy (https://github.com/sympy/sympy)
-     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | Unknown | list[Min | Max | Basic] | list[Basic] | list[Poly | Basic] | list[Min | Max] | list[Unknown] | list[Poly])" (reportUnknownVariableType)
+     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (list[Expr] | list[Function | Pow] | list[Basic | Expr] | list[Basic | Function | Pow] | Unknown | list[Basic | Min | Max] | list[Basic | Unknown] | list[Basic | Poly] | list[Min | Max] | list[Unknown] | list[Poly])" (reportUnknownVariableType)
-     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | Unknown | list[Min | Max | Basic] | list[Basic] | list[Poly | Basic] | list[Min | Max] | list[Unknown] | list[Poly])" (reportUnknownVariableType)
+     Type of "decompogen" is "(f: Unknown, symbol: Unknown) -> (list[Expr] | list[Function | Pow] | list[Basic | Expr] | list[Basic | Function | Pow] | Unknown | list[Basic | Min | Max] | list[Basic | Unknown] | list[Basic | Poly] | list[Min | Max] | list[Unknown] | list[Poly])" (reportUnknownVariableType)
-     Type of "g_s" is "list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | list[Basic] | Unknown | list[Min | Max | Basic] | list[Poly | Basic] | list[Min | Max] | list[Unknown] | list[Poly]" (reportUnknownVariableType)
+     Type of "g_s" is "list[Expr] | list[Function | Pow] | list[Basic | Expr] | list[Basic | Function | Pow] | Unknown | list[Basic | Min | Max] | list[Basic | Unknown] | list[Basic | Poly] | list[Min | Max] | list[Unknown] | list[Poly]" (reportUnknownVariableType)
-     Argument type is "list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | list[Basic] | Unknown | list[Min | Max | Basic] | list[Poly | Basic] | list[Min | Max] | list[Unknown] | list[Poly]" (reportUnknownArgumentType)
+     Argument type is "list[Expr] | list[Function | Pow] | list[Basic | Expr] | list[Basic | Function | Pow] | Unknown | list[Basic | Min | Max] | list[Basic | Unknown] | list[Basic | Poly] | list[Min | Max] | list[Unknown] | list[Poly]" (reportUnknownArgumentType)
-     Argument type is "list[Expr] | list[Function | Pow] | list[Expr | Basic] | list[Function | Pow | Basic] | list[Basic] | Unknown | list[Min | Max | Basic] | list[Poly | Basic] | list[Min | Max] | list[Unknown] | list[Poly]" (reportUnknownArgumentType)
+     Argument type is "list[Expr] | list[Function | Pow] | list[Basic | Expr] | list[Basic | Function | Pow] | Unknown | list[Basic | Min | Max] | list[Basic | Unknown] | list[Basic | Poly] | list[Min | Max] | list[Unknown] | list[Poly]" (reportUnknownArgumentType)
-     Type of "gen" is "list[Unknown] | list[int]" (reportUnknownVariableType)
+     Type of "gen" is "list[Unknown] | list[int] | list[int | Unknown]" (reportUnknownVariableType)
-     Type of "gen" is "list[Unknown] | list[int]" (reportUnknownVariableType)
+     Type of "gen" is "list[Unknown] | list[int] | list[int | Unknown]" (reportUnknownVariableType)
+   .../projects/sympy/sympy/combinatorics/perm_groups.py:3663:21 - warning: Type of "slp" is partially unknown
+     Type of "slp" is "list[tuple[int, int] | tuple[int, Unknown]]" (reportUnknownVariableType)
-   .../projects/sympy/sympy/combinatorics/tensor_can.py:857:5 - warning: Return type, "list[list[Unknown]]", is partially unknown (reportUnknownParameterType)
+   .../projects/sympy/sympy/combinatorics/tensor_can.py:857:5 - warning: Return type, "list[list[Unknown | int] | list[int]]", is partially unknown (reportUnknownParameterType)
-     Type of "gens1" is "list[list[Unknown]]" (reportUnknownVariableType)
+     Type of "gens1" is "list[list[Unknown | int]]" (reportUnknownVariableType)
-     Type of "gens1" is "list[list[Unknown]]" (reportUnknownVariableType)
+     Type of "gens1" is "list[list[Unknown | int]]" (reportUnknownVariableType)
-     Type of "res" is "list[list[Unknown]]" (reportUnknownVariableType)
+     Type of "res" is "list[list[Unknown | int] | list[int]]" (reportUnknownVariableType)
-   .../projects/sympy/sympy/combinatorics/tensor_can.py:891:12 - warning: Return type, "list[list[Unknown]]", is partially unknown (reportUnknownVariableType)
+   .../projects/sympy/sympy/combinatorics/tensor_can.py:891:12 - warning: Return type, "list[list[Unknown | int] | list[int]]", is partially unknown (reportUnknownVariableType)
-     Type of "gens" is "list[list[Unknown]]" (reportUnknownVariableType)
+     Type of "gens" is "list[list[Unknown | int] | list[int]]" (reportUnknownVariableType)
-     Argument type is "list[Unknown]" (reportUnknownArgumentType)
+     Argument type is "list[Unknown | int] | list[int]" (reportUnknownArgumentType)
-     Type of "gens" is "list[list[Unknown]]" (reportUnknownVariableType)
+     Type of "gens" is "list[list[Unknown | int] | list[int]]" (reportUnknownVariableType)
-     Type of "h" is "list[Unknown]" (reportUnknownVariableType)
+     Type of "h" is "list[Unknown | int] | list[int]" (reportUnknownVariableType)
-     Type of "h" is "list[int] | list[Unknown]" (reportUnknownVariableType)
+     Type of "h" is "list[int] | list[Unknown | int]" (reportUnknownVariableType)
-     Type of "big" is "list[Unknown]" (reportUnknownVariableType)
+     Type of "big" is "list[Unknown | int]" (reportUnknownVariableType)
-     Type of "perm_af_direct_product" is "(gens1: Unknown, gens2: Unknown, signed: bool = True) -> list[list[Unknown]]" (reportUnknownVariableType)
+     Type of "perm_af_direct_product" is "(gens1: Unknown, gens2: Unknown, signed: bool = True) -> list[list[Unknown | int] | list[int]]" (reportUnknownVariableType)
-   .../projects/sympy/sympy/concrete/expr_with_limits.py:22:5 - warning: Return type, "Equality | BooleanFalse | BooleanTrue | NaN | tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown], Unknown | Literal[1]]", is partially unknown (reportUnknownParameterType)
+   .../projects/sympy/sympy/concrete/expr_with_limits.py:22:5 - warning: Return type, "Equality | BooleanFalse | BooleanTrue | NaN | tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown | Tuple], Unknown | Literal[1]]", is partially unknown (reportUnknownParameterType)
-     Type of "limits" is "Unknown | list[Unknown]" (reportUnknownVariableType)
+     Type of "limits" is "Unknown | list[Unknown | Tuple]" (reportUnknownVariableType)
-   .../projects/sympy/sympy/concrete/expr_with_limits.py:90:12 - warning: Return type, "tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown], Unknown | Literal[1]]", is partially unknown (reportUnknownVariableType)
+   .../projects/sympy/sympy/concrete/expr_with_limits.py:90:12 - warning: Return type, "tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown | Tuple], Unknown | Literal[1]]", is partially unknown (reportUnknownVariableType)
-     Type of "pre" is "Equality | BooleanFalse | BooleanTrue | NaN | tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown], Unknown | Literal[1]]" (reportUnknownVariableType)
+     Type of "pre" is "Equality | BooleanFalse | BooleanTrue | NaN | tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown | Tuple], Unknown | Literal[1]]" (reportUnknownVariableType)
-     Type of "limits" is "Unknown | list[Tuple] | list[Unknown]" (reportUnknownVariableType)
+     Type of "limits" is "Unknown | list[Tuple] | list[Unknown | Tuple]" (reportUnknownVariableType)
-     Type of "pre" is "Equality | BooleanFalse | BooleanTrue | NaN | tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown], Unknown | Literal[1]]" (reportUnknownVariableType)
+     Type of "pre" is "Equality | BooleanFalse | BooleanTrue | NaN | tuple[Unknown | Basic | Piecewise, Unknown | list[Tuple] | list[Unknown | Tuple], Unknown | Literal[1]]" (reportUnknownVariableType)
-     Type of "limits" is "Unknown | list[Tuple] | list[Unknown]" (reportUnknownVariableType)
+     Type of "limits" is "Unknown | list[Tuple] | list[Unknown | Tuple]" (reportUnknownVariableType)
-   .../projects/sympy/sympy/core/add.py:252:33 - error: Type "list[Order | Expr]" is not assignable to declared type "list[Order]"
+   .../projects/sympy/sympy/core/add.py:252:33 - error: Type "list[Expr | Order]" is not assignable to declared type "list[Order]"
-     "list[Order | Expr]" is not assignable to "list[Order]"
+     "list[Expr | Order]" is not assignable to "list[Order]"
-       Type parameter "_T@list" is invariant, but "Order | Expr" is not the same as "Order"
+       Type parameter "_T@list" is invariant, but "Expr | Order" is not the same as "Order"
-     Type of "newseq" is "list[Unknown]" (reportUnknownVariableType)
+     Type of "newseq" is "list[Unknown | Order]" (reportUnknownVariableType)
-     Type of "insert" is "(index: SupportsIndex, object: Unknown, /) -> None" (reportUnknownMemberType)
+     Type of "insert" is "((index: SupportsIndex, object: Unknown | Order, /) -> None) | ((index: SupportsIndex, object: Unknown, /) -> None)" (reportUnknownMemberType)
-     Type of "newseq" is "list[Unknown]" (reportUnknownVariableType)
+     Type of "newseq" is "list[Unknown | Order] | list[Unknown]" (reportUnknownVariableType)
-   .../projects/sympy/sympy/core/add.py:404:20 - warning: Return type, "tuple[list[Expr], list[Unknown], None]", is partially unknown (reportUnknownVariableType)
+   .../projects/sympy/sympy/core/add.py:404:20 - warning: Return type, "tuple[list[Expr], list[Unknown | Order] | list[Unknown], None]", is partially unknown (reportUnknownVariableType)
+   .../projects/sympy/sympy/core/add.py:404:24 - error: Type "tuple[list[Expr], list[Unknown | Order] | list[Unknown], None]" is not assignable to return type "tuple[list[Expr], list[Expr], None]"

... (truncated 4926 lines) ...

paasta (https://github.com/yelp/paasta)
-     Type of "virtual_service" is "dict[str, str | dict[str, str] | dict[str, list[str] | list[dict[str, list[dict[str, dict[str, dict[str, Unknown]]]] | dict[str, str]]]]]" (reportUnknownVariableType)
+     Type of "virtual_service" is "dict[str, str | dict[str, str] | dict[str, list[dict[str, list[dict[str, dict[str, dict[str, Unknown]]]] | dict[str, str]] | dict[str, list[dict[str, Unknown]] | dict[str, str]]]]]" (reportUnknownVariableType)
-     Argument type is "dict[str, list[str] | list[dict[str, list[dict[str, dict[str, dict[str, Unknown]]]] | dict[str, str]]]]" (reportUnknownArgumentType)
+     Argument type is "dict[str, list[dict[str, list[dict[str, dict[str, dict[str, Unknown]]]] | dict[str, str]] | dict[str, list[dict[str, Unknown]] | dict[str, str]]]]" (reportUnknownArgumentType)
-     Argument type is "list[dict[str, list[dict[str, dict[str, dict[str, Unknown]]]] | dict[str, str]]]" (reportUnknownArgumentType)
+     Argument type is "list[dict[str, list[dict[str, Unknown]] | dict[str, str]] | dict[str, list[dict[str, dict[str, dict[str, Unknown]]]] | dict[str, str]]]" (reportUnknownArgumentType)

bokeh (https://github.com/bokeh/bokeh)
-   .../projects/bokeh/src/bokeh/model/model.py:326:16 - warning: Return type, "list[Unknown]", is partially unknown (reportUnknownVariableType)
+   .../projects/bokeh/src/bokeh/model/model.py:326:16 - warning: Return type, "list[Parameter | Unknown]", is partially unknown (reportUnknownVariableType)
-     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown]" (reportUnknownMemberType)
+     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown | str]" (reportUnknownMemberType)
-     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown]" (reportUnknownMemberType)
+     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown | str]" (reportUnknownMemberType)
-   .../projects/bokeh/src/bokeh/models/mappers.py:380:26 - error: Argument of type "Nullable[str] | Unknown | list[Unknown]" cannot be assigned to parameter "obj" of type "Sized" in function "len"
+   .../projects/bokeh/src/bokeh/models/mappers.py:380:26 - error: Argument of type "Nullable[str] | Unknown | list[Unknown | str]" cannot be assigned to parameter "obj" of type "Sized" in function "len"
-     Type "Nullable[str] | Unknown | list[Unknown]" is not assignable to type "Sized"
+     Type "Nullable[str] | Unknown | list[Unknown | str]" is not assignable to type "Sized"
-     Type of "stack_labels" is "Unknown | list[Unknown]" (reportUnknownMemberType)
+     Type of "stack_labels" is "Unknown | list[Unknown | str]" (reportUnknownMemberType)
-     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown]" (reportUnknownMemberType)
+     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown | str]" (reportUnknownMemberType)
-     Type of "stack_labels" is "list[Unknown]" (reportUnknownMemberType)
+     Type of "stack_labels" is "list[Unknown | str]" (reportUnknownMemberType)
-     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown]" (reportUnknownMemberType)
+     Type of "stack_labels" is "Nullable[str] | Unknown | list[Unknown | str]" (reportUnknownMemberType)
-   .../projects/bokeh/src/bokeh/models/mappers.py:386:42 - error: Argument of type "Nullable[str] | Unknown | list[Unknown]" cannot be assigned to parameter "iterable" of type "Iterable[_T@list]" in function "__init__"
+   .../projects/bokeh/src/bokeh/models/mappers.py:386:42 - error: Argument of type "Nullable[str] | Unknown | list[Unknown | str]" cannot be assigned to parameter "iterable" of type "Iterable[_T@list]" in function "__init__"
-     Type "Nullable[str] | Unknown | list[Unknown]" is not assignable to type "Iterable[_T@list]"
+     Type "Nullable[str] | Unknown | list[Unknown | str]" is not assignable to type "Iterable[_T@list]"
-   .../projects/bokeh/src/bokeh/sphinxext/bokeh_plot.py:159:9 - warning: Return type, "list[Unknown] | list[literal_block | autoload_script | Node | target] | Unknown", is partially unknown (reportUnknownParameterType)
+   .../projects/bokeh/src/bokeh/sphinxext/bokeh_plot.py:159:9 - warning: Return type, "list[Unknown] | list[target | Node | literal_block | autoload_script] | Unknown", is partially unknown (reportUnknownParameterType)
-   .../projects/bokeh/src/bokeh/sphinxext/bokeh_plot.py:188:16 - warning: Return type, "list[literal_block | autoload_script | Node | target] | Unknown", is partially unknown (reportUnknownVariableType)
+   .../projects/bokeh/src/bokeh/sphinxext/bokeh_plot.py:188:16 - warning: Return type, "list[target | Node | literal_block | autoload_script] | Unknown", is partially unknown (reportUnknownVariableType)

openlibrary (https://github.com/internetarchive/openlibrary)
-   .../projects/openlibrary/openlibrary/plugins/upstream/account.py:1324:13 - error: Argument of type "(item: dict[str, Any] | Edition) -> (Any | Unknown | None)" cannot be assigned to parameter "key" of type "(dict[str, Any] | Edition) -> SupportsRichComparison" in function "sort"
+   .../projects/openlibrary/openlibrary/plugins/upstream/account.py:1324:13 - error: Argument of type "(item: Edition | dict[str, Any]) -> (Any | Unknown | None)" cannot be assigned to parameter "key" of type "(Edition | dict[str, Any]) -> SupportsRichComparison" in function "sort"
-     Type "(item: dict[str, Any] | Edition) -> (Any | Unknown | None)" is not assignable to type "(dict[str, Any] | Edition) -> SupportsRichComparison"
+     Type "(item: Edition | dict[str, Any]) -> (Any | Unknown | None)" is not assignable to type "(Edition | dict[str, Any]) -> SupportsRichComparison"
-     Type of "get" is "Overload[(key: str, default: None = None, /) -> (Any | None), (key: str, default: Any, /) -> Any, (key: str, default: _T@get, /) -> (Any | _T@get)] | ((key: Unknown, default: Unknown | None = None) -> (Unknown | None))" (reportUnknownMemberType)
+     Type of "get" is "((key: Unknown, default: Unknown | None = None) -> (Unknown | None)) | Overload[(key: str, default: None = None, /) -> (Any | None), (key: str, default: Any, /) -> Any, (key: str, default: _T@get, /) -> (Any | _T@get)]" (reportUnknownMemberType)
-   .../projects/openlibrary/openlibrary/plugins/upstream/models.py:61:9 - warning: Return type, "Any | Unknown | list[Unknown]", is partially unknown (reportUnknownParameterType)
+   .../projects/openlibrary/openlibrary/plugins/upstream/models.py:61:9 - warning: Return type, "Any | Unknown | list[Unknown | Any | str]", is partially unknown (reportUnknownParameterType)
-   .../projects/openlibrary/openlibrary/plugins/upstream/models.py:66:16 - warning: Return type, "Any | Unknown | list[Unknown]", is partially unknown (reportUnknownVariableType)
+   .../projects/openlibrary/openlibrary/plugins/upstream/models.py:66:16 - warning: Return type, "Any | Unknown | list[Unknown | Any | str]", is partially unknown (reportUnknownVariableType)
-     Type of "params" is "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown]]" (reportUnknownVariableType)
+     Type of "params" is "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any]]" (reportUnknownVariableType)
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)
-     Type of "params" is "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown]]" (reportUnknownVariableType)
+     Type of "params" is "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any]]" (reportUnknownVariableType)
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)
-     Type of "params" is "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown]]" (reportUnknownVariableType)
+     Type of "params" is "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any]]" (reportUnknownVariableType)
-   .../projects/openlibrary/openlibrary/plugins/worksearch/code.py:315:59 - error: Argument of type "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown]]" cannot be assigned to parameter "cur_solr_params" of type "list[tuple[str, str]]" in function "q_to_solr_params"
+   .../projects/openlibrary/openlibrary/plugins/worksearch/code.py:315:59 - error: Argument of type "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any]]" cannot be assigned to parameter "cur_solr_params" of type "list[tuple[str, str]]" in function "q_to_solr_params"
-     "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown]]" is not assignable to "list[tuple[str, str]]"
+     "list[tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any]]" is not assignable to "list[tuple[str, str]]"
-       Type parameter "_T@list" is invariant, but "tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown]" is not the same as "tuple[str, str]"
+       Type parameter "_T@list" is invariant, but "tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any]" is not the same as "tuple[str, str]"
-     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown], /) -> None" (reportUnknownMemberType)
+     Type of "append" is "(object: tuple[str, str] | tuple[str, int | Unknown] | tuple[str, int] | tuple[str, Unknown] | tuple[str, Any], /) -> None" (reportUnknownMemberType)

scikit-learn (https://github.com/scikit-learn/scikit-learn)
+   .../projects/scikit-learn/sklearn/ensemble/tests/test_bagging.py:106:9 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "iter1" in function "__new__"
+     Argument type is "list[type[csc_array[Any]] | type[csc_matrix[Any]] | Unknown | type[csr_matrix[Any]] | type[csr_array[Any, tuple[int, int]]]]" (reportUnknownArgumentType)
+   .../projects/scikit-learn/sklearn/ensemble/tests/test_weight_boosting.py:310:9 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "iter2" in function "__new__"
+     Argument type is "list[type[csr_array[Any, tuple[int, int]]] | type[csr_matrix[Any]] | Unknown | type[csc_matrix[Any]] | type[csc_array[Any]]]" (reportUnknownArgumentType)
+   .../projects/scikit-learn/sklearn/ensemble/tests/test_weight_boosting.py:413:9 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "iter2" in function "__new__"
+     Argument type is "list[type[csr_array[Any, tuple[int, int]]] | type[csr_matrix[Any]] | Unknown | type[csc_matrix[Any]] | type[csc_array[Any]]]" (reportUnknownArgumentType)
-     Type of "__all__" is "list[Unknown]" (reportUnknownVariableType)
+     Type of "__all__" is "list[Unknown | str]" (reportUnknownVariableType)
-     Type of "__all__" is "list[Unknown]" (reportUnknownVariableType)
+     Type of "__all__" is "list[Unknown | str]" (reportUnknownVariableType)
+   .../projects/scikit-learn/sklearn/feature_extraction/image.py:348:5 - warning: Type of "shape" is partially unknown
+     Type of "shape" is "tuple[Unknown | Any, ...]" (reportUnknownVariableType)
+   .../projects/scikit-learn/sklearn/feature_extraction/image.py:348:19 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "iterable" in function "__new__"
+     Argument type is "list[Unknown | Any]" (reportUnknownArgumentType)
+   .../projects/scikit-learn/sklearn/feature_extraction/image.py:351:37 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "shape" in function "as_strided"
+     Argument type is "tuple[Unknown | Any, ...]" (reportUnknownArgumentType)
-   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:319:9 - warning: Type of "patches" is partially unknown
+   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:319:9 - warning: Type of "patches" is unknown (reportUnknownVariableType)
-     Type of "patches" is "ndarray[tuple[Any, ...], dtype[Unknown]]" (reportUnknownVariableType)
-   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:320:32 - error: Argument of type "tuple[int, int, int] | tuple[int, int] | tuple[int]" cannot be assigned to parameter "patch_shape" of type "int" in function "_extract_patches"
+   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:320:32 - error: Argument of type "tuple[int] | tuple[int, int] | tuple[int, int, int]" cannot be assigned to parameter "patch_shape" of type "int" in function "_extract_patches"
-     Type "tuple[int, int, int] | tuple[int, int] | tuple[int]" is not assignable to type "int"
+     Type "tuple[int] | tuple[int, int] | tuple[int, int, int]" is not assignable to type "int"
-       "tuple[int, int, int]" is not assignable to "int" (reportArgumentType)
+       "tuple[int]" is not assignable to "int" (reportArgumentType)
-   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:320:60 - error: Argument of type "tuple[int, int, int] | tuple[int, int] | tuple[int]" cannot be assigned to parameter "extraction_step" of type "int" in function "_extract_patches"
+   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:320:60 - error: Argument of type "tuple[int] | tuple[int, int] | tuple[int, int, int]" cannot be assigned to parameter "extraction_step" of type "int" in function "_extract_patches"
-     Type "tuple[int, int, int] | tuple[int, int] | tuple[int]" is not assignable to type "int"
+     Type "tuple[int] | tuple[int, int] | tuple[int, int, int]" is not assignable to type "int"
-       "tuple[int, int, int]" is not assignable to "int" (reportArgumentType)
+       "tuple[int]" is not assignable to "int" (reportArgumentType)
+   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:325:16 - warning: Type of "shape" is unknown (reportUnknownMemberType)
-   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:329:16 - warning: Type of "all" is Any (reportAny)
+   .../projects/scikit-learn/sklearn/feature_extraction/tests/test_image.py:329:16 - warning: Type of "all" is unknown (reportUnknownMemberType)
+   .../projects/scikit-learn/sklearn/impute/tests/test_impute.py:1235:9 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "iterable" in function "__init__"
+     Argument type is "product[tuple[Unknown | type[csc_matrix[Any]] | type[csc_array[Any]] | type[csr_matrix[Any]] | type[csr_array[Any, tuple[int, int]]] | type[coo_matrix[Any]] | type[coo_array[Any, tuple[Any, ...]]] | type[lil_matrix[Any]] | type[lil_array[Any]] | type[bsr_matrix[Any]] | type[bsr_array[Any]], float]]" (reportUnknownArgumentType)
+   .../projects/scikit-learn/sklearn/impute/tests/test_impute.py:1236:13 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "iter1" in function "__new__"

... (truncated 916 lines) ...```

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive reportAssignmentType with list.__add__ type widening from a newly-created object

2 participants