Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminated type evaluation order dependency that results from return … #9658

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

erictraut
Copy link
Collaborator

…type inference that involves recursion. This addresses #9642.

…type inference that involves recursion. This addresses #9642.
Copy link
Contributor

github-actions bot commented Jan 3, 2025

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

paasta (https://github.com/yelp/paasta)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/cli/cmds/mark_for_deployment.py:1563:22 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/cli/cmds/status.py:1080:56 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/cli/cmds/status.py:1082:53 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/cli/cmds/status.py:1263:25 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/cli/cmds/status.py:1284:22 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/cli/cmds/status.py:1306:57 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:145:29 - error: Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to declared type "Dict[str, Any] | None"
-     Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to type "Dict[str, Any] | None"
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:145:29 - error: Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to declared type "Dict[str, Any] | None"
+     Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to type "Dict[str, Any] | None"
-   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:151:27 - error: Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to declared type "Dict[str, Any] | None"
-     Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to type "Dict[str, Any] | None"
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:151:27 - error: Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to declared type "Dict[str, Any] | None"
+     Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to type "Dict[str, Any] | None"
-   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:163:28 - error: Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to declared type "List[Tuple[str, Any]] | None"
-     Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to type "List[Tuple[str, Any]] | None"
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:163:28 - error: Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to declared type "List[Tuple[str, Any]] | None"
+     Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to type "List[Tuple[str, Any]] | None"
-   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:170:27 - error: Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to declared type "List[Tuple[str, Any]] | None"
-     Type "dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None" is not assignable to type "List[Tuple[str, Any]] | None"
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/api_client.py:170:27 - error: Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to declared type "List[Tuple[str, Any]] | None"
+     Type "dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | str | int | float | bool | dict[Unknown, Unknown] | Unknown | list[dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None] | dict[Unknown, dict[Unknown, Unknown] | str | int | float | bool | Unknown | list[Unknown] | None] | None" is not assignable to type "List[Tuple[str, Any]] | None"
-   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/model_utils.py:142:24 - error: "required_types_mixed" is possibly unbound (reportPossiblyUnboundVariable)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/model_utils.py:142:24 - error: "required_types_mixed" is unbound (reportUnboundVariable)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/model_utils.py:396:36 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/model_utils.py:443:35 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/paasta/paasta_tools/paastaapi/model_utils.py:477:35 - error: "NoReturn" is not iterable (reportGeneralTypeIssues)

... (truncated 4 lines) ...

openlibrary (https://github.com/internetarchive/openlibrary)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/api.py:192:17 - error: "datetime" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/api.py:192:17 - error: "datetime" is not iterable (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/api.py:193:24 - error: Argument of type "Generator[Unknown, Unknown, None] | list[list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]" cannot be assigned to parameter "obj" of type "Sized" in function "len"
+     Type "Generator[Unknown, Unknown, None] | list[list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]" is not assignable to type "Sized"
+       "datetime" is incompatible with protocol "Sized"
+         "__len__" is not present (reportArgumentType)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/api.py:195:36 - error: Argument of type "Generator[Unknown, Unknown, None] | list[list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]" cannot be assigned to parameter "obj" of type "Sized" in function "len"
+     Type "Generator[Unknown, Unknown, None] | list[list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]] | Reference | Text | datetime | Unknown | dict[Unknown, list[Unknown] | Reference | Text | datetime | Unknown | dict[Unknown, Unknown]]" is not assignable to type "Sized"
+       "datetime" is incompatible with protocol "Sized"
+         "__len__" is not present (reportArgumentType)
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:598:23 - error: Operator "|" not supported for types "dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | Unknown | dict[str, str]" and "dict[str, Any]"
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:598:23 - error: Operator "|" not supported for types "dict[Unknown, dict[Unknown, Unknown] | list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | dict[str, Unknown] | dict[str, str] | Unknown" and "dict[str, Any]"
-     Operator "|" not supported for types "list[Unknown]" and "dict[str, Any]" when expected type is "dict[str, Any]" (reportOperatorIssue)
+     Operator "|" not supported for types "list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown]" and "dict[str, Any]" when expected type is "dict[str, Any]" (reportOperatorIssue)
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:853:41 - error: Argument of type "str | Unknown | dict[Any, Any]" cannot be assigned to parameter "iterable" of type "Iterable[tuple[str, _VT@defaultdict]]" in function "__init__"
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:853:41 - error: Argument of type "str | Unknown | dict[Unknown, Unknown] | list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | dict[str, Unknown] | dict[str, str]" cannot be assigned to parameter "iterable" of type "Iterable[tuple[str, _VT@defaultdict]]" in function "__init__"
-     Type "str | Unknown | dict[Any, Any]" is not assignable to type "Iterable[tuple[str, list[Unknown]]]"
+     Type "str | Unknown | dict[Unknown, Unknown] | list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | dict[str, Unknown] | dict[str, str]" is not assignable to type "Iterable[tuple[str, list[Unknown]]]"
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:853:56 - error: Cannot access attribute "get" for class "list[Unknown]"
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:853:56 - error: Cannot access attribute "get" for class "list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown]"
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:857:27 - error: Cannot access attribute "get" for class "list[Unknown]"
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/catalog/add_book/__init__.py:857:27 - error: Cannot access attribute "get" for class "list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown]"
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/core/lists/model.py:206:16 - error: Type "dict[str, list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | Unknown | dict[str, str]]]" is not assignable to return type "dict[str, list[dict[Unknown, Unknown]]]" (reportReturnType)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/core/lists/model.py:206:16 - error: Type "dict[str, list[dict[Unknown, dict[Unknown, Unknown] | list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | list[dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown] | dict[str, Unknown] | dict[str, str] | Unknown]]" is not assignable to return type "dict[str, list[dict[Unknown, Unknown]]]" (reportReturnType)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/data/dump.py:66:20 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/data/dump.py:66:20 - error: Argument of type "Literal['key']" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+     "Literal['key']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/data/dump.py:67:21 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/data/dump.py:67:21 - error: Argument of type "Literal['value']" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+     "Literal['value']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/plugins/openlibrary/connection.py:533:65 - error: Cannot access attribute "items" for class "list[Unknown]"
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/plugins/openlibrary/connection.py:533:65 - error: Cannot access attribute "items" for class "list[list[Unknown] | dict[Unknown, list[Unknown] | dict[Unknown, Unknown] | Unknown] | Unknown]"
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/plugins/upstream/utils.py:343:12 - error: Type "list[Unknown] | Unknown" is not assignable to return type "dict[Unknown, Unknown]"
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/plugins/upstream/utils.py:343:12 - error: Type "list[list[list[Unknown] | Unknown] | Unknown] | Unknown" is not assignable to return type "dict[Unknown, Unknown]"
-     Type "list[Unknown] | Unknown" is not assignable to type "dict[Unknown, Unknown]"
+     Type "list[list[list[Unknown] | Unknown] | Unknown] | Unknown" is not assignable to type "dict[Unknown, Unknown]"
-       "list[Unknown]" is not assignable to "dict[Unknown, Unknown]" (reportReturnType)
+       "list[list[list[Unknown] | Unknown] | Unknown]" is not assignable to "dict[Unknown, Unknown]" (reportReturnType)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/records/functions.py:256:19 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/records/functions.py:256:19 - error: Argument of type "Literal['key']" cannot be assigned to parameter "s" of type "slice[Any, Any, Any]" in function "__getitem__"
+     "Literal['key']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/records/functions.py:263:25 - error: Argument of type "dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown" cannot be assigned to parameter "key" of type "str" in function "pop"
+     Type "dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown" is not assignable to type "str"
+       "dict[str, str]" is not assignable to "str" (reportArgumentType)
-   /tmp/mypy_primer/projects/openlibrary/openlibrary/records/functions.py:263:25 - error: Argument of type "str" cannot be assigned to parameter "index" of type "SupportsIndex" in function "pop"
+   /tmp/mypy_primer/projects/openlibrary/openlibrary/records/functions.py:263:25 - error: Argument of type "dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown" cannot be assigned to parameter "index" of type "SupportsIndex" in function "pop"
+     Type "dict[Unknown, Unknown] | list[Unknown] | dict[str, Unknown] | dict[str, str] | Unknown" is not assignable to type "SupportsIndex"
-     "str" is incompatible with protocol "SupportsIndex"
+       "dict[str, str]" is incompatible with protocol "SupportsIndex"
-       "__index__" is not present (reportArgumentType)
+         "__index__" is not present (reportArgumentType)

... (truncated 8 lines) ...

pytest (https://github.com/pytest-dev/pytest)
-   /tmp/mypy_primer/projects/pytest/src/_pytest/python_api.py:180:55 - error: Argument of type "list[Unknown] | tuple[Unknown, ...] | Unknown" cannot be assigned to parameter "nested_list" of type "list[Any]" in function "get_value_from_nested_list"
+   /tmp/mypy_primer/projects/pytest/src/_pytest/python_api.py:180:55 - error: Argument of type "list[Unknown] | tuple[Unknown, ...] | list[list[Unknown] | tuple[Unknown, ...] | Unknown] | Unknown" cannot be assigned to parameter "nested_list" of type "list[Any]" in function "get_value_from_nested_list"
-     Type "list[Unknown] | tuple[Unknown, ...] | Unknown" is not assignable to type "list[Any]"
+     Type "list[Unknown] | tuple[Unknown, ...] | list[list[Unknown] | tuple[Unknown, ...] | Unknown] | Unknown" is not assignable to type "list[Any]"
-   /tmp/mypy_primer/projects/pytest/src/_pytest/python_api.py:195:48 - error: Argument of type "list[Unknown] | tuple[Unknown, ...] | Unknown" cannot be assigned to parameter "nested_list" of type "list[Any]" in function "get_value_from_nested_list"
+   /tmp/mypy_primer/projects/pytest/src/_pytest/python_api.py:195:48 - error: Argument of type "list[Unknown] | tuple[Unknown, ...] | list[list[Unknown] | tuple[Unknown, ...] | Unknown] | Unknown" cannot be assigned to parameter "nested_list" of type "list[Any]" in function "get_value_from_nested_list"
-     Type "list[Unknown] | tuple[Unknown, ...] | Unknown" is not assignable to type "list[Any]"
+     Type "list[Unknown] | tuple[Unknown, ...] | list[list[Unknown] | tuple[Unknown, ...] | Unknown] | Unknown" is not assignable to type "list[Any]"
+   /tmp/mypy_primer/projects/pytest/src/_pytest/python_api.py:344:49 - error: Cannot access attribute "expected" for class "list[Unknown]"
+     Attribute "expected" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/pytest/src/_pytest/python_api.py:344:49 - error: Cannot access attribute "expected" for class "tuple[Unknown, ...]"
+     Attribute "expected" is unknown (reportAttributeAccessIssue)
- 763 errors, 43 warnings, 0 informations 
+ 765 errors, 43 warnings, 0 informations 

sympy (https://github.com/sympy/sympy)
+   /tmp/mypy_primer/projects/sympy/sympy/codegen/ast.py:872:7 - error: Base classes for class "String" define method "sort_key" in incompatible way
+     Return type mismatch: base method returns type "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]", override returns type "tuple[tuple[Literal[2], Literal[0], str], tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
+       "tuple[tuple[Literal[2], Literal[0], str], tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]" is not assignable to "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
+         Tuple entry 2 is incorrect type
+           "tuple[int, tuple[str]]" is not assignable to "tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]]"
+             Tuple entry 2 is incorrect type (reportIncompatibleMethodOverride)
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/fp_groups.py:963:22 - error: "FpGroup" is not iterable
+     "__iter__" method not defined (reportGeneralTypeIssues)
-   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/homomorphisms.py:132:19 - error: Operator "**" not supported for types "Unknown | list[Unknown] | None" and "Literal[-1]"
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/homomorphisms.py:132:19 - error: Operator "**" not supported for types "Unknown | list[Unknown | list[Unknown] | None] | None" and "Literal[-1]"
-     Operator "**" not supported for types "list[Unknown]" and "Literal[-1]"
+     Operator "**" not supported for types "list[Unknown | list[Unknown] | None]" and "Literal[-1]"
-   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/homomorphisms.py:264:20 - error: Operator "*" not supported for types "Basic | Unknown" and "Unknown | list[Unknown] | None"
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/homomorphisms.py:264:20 - error: Operator "*" not supported for types "Basic | Unknown" and "Unknown | list[Unknown | list[Unknown] | None] | None"
-     Operator "*" not supported for types "Basic" and "list[Unknown]"
+     Operator "*" not supported for types "Basic" and "list[Unknown | list[Unknown] | None]"
-   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/homomorphisms.py:265:33 - error: Operator "*" not supported for types "Basic | Unknown" and "Unknown | list[Unknown] | None"
+   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/homomorphisms.py:265:33 - error: Operator "*" not supported for types "Basic | Unknown" and "Unknown | list[Unknown | list[Unknown] | None] | None"
-     Operator "*" not supported for types "Basic" and "list[Unknown]"
+     Operator "*" not supported for types "Basic" and "list[Unknown | list[Unknown] | None]"
-     Return type mismatch: base method returns type "tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]", override returns type "tuple[tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], tuple[int, tuple[Unknown, ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]"
-       "tuple[tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], tuple[int, tuple[Unknown, ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]" is not assignable to "tuple[tuple[int, int, str], tuple[int, tuple[Unknown, ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
+     Return type mismatch: base method returns type "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]", override returns type "tuple[tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], tuple[int, tuple[tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[Unknown | int, int, str | Unknown], tuple[int, tuple[Unknown, ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]"
+       "tuple[tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[int, int, str | Unknown], tuple[int, tuple[tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One] | Unknown | tuple[tuple[Unknown | int, int, str | Unknown], tuple[int, tuple[Unknown, ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]] | tuple[int, tuple[str]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]" is not assignable to "tuple[tuple[int, int, str], tuple[int, tuple[tuple[tuple[int, int, str], Unknown, tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One], ...]], tuple[tuple[Literal[1], Literal[0], Literal['Number']], tuple[int, tuple[()]], tuple[()], One], One]"
-   /tmp/mypy_primer/projects/sympy/sympy/combinatorics/perm_groups.py:907:28 - error: Argument of type "Unknown | Coset | Permutation" cannot be assigned to parameter "value" of type "Permutation" in function "index"
-     Type "Unknown | Coset | Permutation" is not assignable to type "Permutation"
-       "Coset" is not assignable to "Permutation" (reportArgumentType)

... (truncated 323 lines) ...```

@erictraut erictraut merged commit 0f57009 into main Jan 3, 2025
18 checks passed
@erictraut erictraut deleted the issue-9642 branch January 3, 2025 22:32
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.

1 participant