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

Improved performance of protocol matching, especially for complex rec… #9168

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

erictraut
Copy link
Collaborator

…ursive protocols. This addresses #9109.

Copy link
Contributor

github-actions bot commented Oct 8, 2024

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

steam.py (https:/Gobot1234/steam.py)
+   /tmp/mypy_primer/projects/steam.py/steam/abc.py:953:16 - error: Type "MessageT@Messageable | None" is not assignable to return type "MessageT@Messageable | None"
+     Type "MessageT@Messageable | None" is not assignable to type "MessageT@Messageable | None"
+       Type "MessageT@Messageable" is not assignable to type "MessageT@Messageable"
+       Type "MessageT@Messageable" is not assignable to type "MessageT@Messageable | None"
+         Type "MessageT@Messageable" is not assignable to type "MessageT@Messageable"
+         "Message[UserT@Message, ChannelT@Message]*" is not assignable to "None" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/chat.py:475:20 - error: Type "ChatMessageT@Chat" is not assignable to return type "ChatMessageT@Chat | None"
+     Type "GroupMessage[PartialMember | GroupMember]* | ClanMessage[PartialMember | ClanMember]*" is not assignable to type "ChatMessageT@Chat | None"
+       Type "ClanMessage[PartialMember | ClanMember]*" is not assignable to type "ChatMessageT@Chat | None"
+         Type "ClanMessage[PartialMember | ClanMember]*" is not assignable to type "ChatMessageT@Chat"
+         "ClanMessage[PartialMember | ClanMember]*" is not assignable to "None" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/chat.py:783:16 - error: Type "Sequence[MemberT@ChatGroup]" is not assignable to return type "Sequence[MemberT@ChatGroup]"
+     "typing.Sequence" is not assignable to "typing.Sequence"
+       Type parameter "_T_co@Sequence" is covariant, but "MemberT@ChatGroup" is not a subtype of "MemberT@ChatGroup"
+         Type "MemberT@ChatGroup" is not assignable to type "MemberT@ChatGroup" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/id.py:462:16 - error: Type "ID[Type]" is not assignable to return type "IndividualID | None"
+     Type "ID[Type]" is not assignable to type "IndividualID | None"
+       "ID[Type]" is not assignable to "ID[Literal[Type.Individual]]"
+         Type parameter "TypeT@ID" is covariant, but "Type" is not a subtype of "Literal[Type.Individual]"
+           "Type" is not assignable to type "Literal[Type.Individual]"
+       "ID[Type]" is not assignable to "None" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/id.py:513:20 - error: Type "ID[Type]" is not assignable to return type "ID[Literal[Type.Individual]] | None"
+     Type "ID[Type]" is not assignable to type "ID[Literal[Type.Individual]] | None"
+       "ID[Type]" is not assignable to "ID[Literal[Type.Individual]]"
+         Type parameter "TypeT@ID" is covariant, but "Type" is not a subtype of "Literal[Type.Individual]"
+           "Type" is not assignable to type "Literal[Type.Individual]"
+       "ID[Type]" is not assignable to "None" (reportReturnType)
-   /tmp/mypy_primer/projects/steam.py/steam/trade.py:440:13 - error: Type of "_update" is unknown (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/steam.py/steam/trade.py:440:19 - error: Cannot access attribute "_update" for class "TradeOffer[ReceivingAssetT@TradeOffer, SendingAssetT@TradeOffer, UserT@TradeOffer]*"
-     Could not bind method "_update" because "Self@TradeOffer[ReceivingAssetT@TradeOffer, SendingAssetT@TradeOffer, UserT@TradeOffer]" is not assignable to parameter "self"
-       "TradeOffer[ReceivingAssetT@TradeOffer, SendingAssetT@TradeOffer, UserT@TradeOffer]*" is not assignable to "TradeOffer[Asset[UserT@TradeOffer], Asset[ClientUser], UserT@TradeOffer]"
-         Type parameter "ReceivingAssetT@TradeOffer" is covariant, but "ReceivingAssetT@TradeOffer" is not a subtype of "Asset[UserT@TradeOffer]"
-           "Asset[PartialUser]*" is not assignable to "Asset[UserT@TradeOffer]"
-             Type parameter "OwnerT@Asset" is covariant, but "PartialUser" is not a subtype of "UserT@TradeOffer"
-     Could not bind method "_update" because "Self@TradeOffer[ReceivingAssetT@TradeOffer, SendingAssetT@TradeOffer, UserT@TradeOffer]" is not assignable to parameter "self"
-       "TradeOffer[ReceivingAssetT@TradeOffer, SendingAssetT@TradeOffer, UserT@TradeOffer]*" is not assignable to "TradeOffer[Asset[UserT@TradeOffer], Asset[ClientUser], UserT@TradeOffer]"
-         Type parameter "ReceivingAssetT@TradeOffer" is covariant, but "ReceivingAssetT@TradeOffer" is not a subtype of "Asset[UserT@TradeOffer]" (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/steam.py/steam/utils.py:151:25 - error: Argument of type "ID[Type]" cannot be assigned to parameter "id" of type "IndividualID" in function "__init__"
+     "ID[Type]" is not assignable to "ID[Literal[Type.Individual]]"
+       Type parameter "TypeT@ID" is covariant, but "Type" is not a subtype of "Literal[Type.Individual]"
+         "Type" is not assignable to type "Literal[Type.Individual]" (reportArgumentType)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/commands/commands.py:230:16 - error: Type "MethodType | ((CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]) | ((Context[Any], **P@Command) -> Coro[R@Command])" is not assignable to return type "((CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]) | ((Context[Any], **P@Command) -> Coro[R@Command])"
+     Type "MethodType | ((CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]) | ((Context[Any], **P@Command) -> Coro[R@Command])" is not assignable to type "((CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]) | ((Context[Any], **P@Command) -> Coro[R@Command])"
+       Type "(CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]" is not assignable to type "((CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]) | ((Context[Any], **P@Command) -> Coro[R@Command])"
+         Type "(CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]" is not assignable to type "(CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]"
+           Function return type "Coro[R@Command]" is incompatible with type "Coro[R@Command]"
+             "typing.Coroutine" is not assignable to "typing.Coroutine"
+         Type "(CogT@Command, Context[Any], **P@Command) -> Coro[R@Command]" is not assignable to type "(Context[Any], **P@Command) -> Coro[R@Command]"
+           Parameter 1: type "Context[Any]" is incompatible with type "CogT@Command"
+             Type "Context[Any]" is not assignable to type "Cog[Bot] | Bot | None"
+     ... (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/commands/commands.py:607:29 - error: Argument of type "Command[CogT@GroupMixin, ..., Any]" cannot be assigned to parameter "object" of type "Command[CogT@GroupMixin, ..., Any]" in function "append"
+     "steam.ext.commands.commands.Command" is not assignable to "steam.ext.commands.commands.Command"
+       Type parameter "CogT@Command" is covariant, but "CogT@GroupMixin" is not a subtype of "CogT@GroupMixin"
+         Type "CogT@GroupMixin" is not assignable to type "CogT@GroupMixin" (reportArgumentType)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/commands/commands.py:609:17 - error: Operator "+=" not supported for types "list[Command[CogT@GroupMixin, ..., Any]]" and "Sequence[Command[CogT@GroupMixin, ..., Any]]"
+     Operator "+" not supported for types "list[Command[CogT@GroupMixin, ..., Any]]" and "Sequence[Command[CogT@GroupMixin, ..., Any]]" (reportOperatorIssue)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/commands/commands.py:657:16 - error: Type "Command[CogT@GroupMixin, ..., Any]" is not assignable to return type "Command[CogT@GroupMixin, ..., Any] | None"
+     Type "Command[CogT@GroupMixin, ..., Any]" is not assignable to type "Command[CogT@GroupMixin, ..., Any] | None"
+       "steam.ext.commands.commands.Command" is not assignable to "steam.ext.commands.commands.Command"
+         Type parameter "CogT@Command" is covariant, but "CogT@GroupMixin" is not a subtype of "CogT@GroupMixin"
+           Type "CogT@GroupMixin" is not assignable to type "CogT@GroupMixin"
+       "Command[CogT@GroupMixin, ..., Any]" is not assignable to "None" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/commands/commands.py:681:20 - error: Type "Command[CogT@GroupMixin, ..., Any] | None" is not assignable to return type "Command[CogT@GroupMixin, ..., Any] | None"
+     Type "Command[CogT@GroupMixin, ..., Any] | None" is not assignable to type "Command[CogT@GroupMixin, ..., Any] | None"
+       Type "Command[CogT@GroupMixin, ..., Any]" is not assignable to type "Command[CogT@GroupMixin, ..., Any] | None"
+         "steam.ext.commands.commands.Command" is not assignable to "steam.ext.commands.commands.Command"
+           Type parameter "CogT@Command" is covariant, but "CogT@GroupMixin" is not a subtype of "CogT@GroupMixin"
+             Type "CogT@GroupMixin" is not assignable to type "CogT@GroupMixin"
+         "Command[CogT@GroupMixin, ..., Any]" is not assignable to "None" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/commands/commands.py:689:16 - error: Type "Group[CogT@GroupMixin, ..., Any] | Command[CogT@GroupMixin, ..., Any] | Unknown" is not assignable to return type "Command[CogT@GroupMixin, ..., Any] | None"
+     Type "Group[CogT@GroupMixin, ..., Any] | Command[CogT@GroupMixin, ..., Any] | Unknown" is not assignable to type "Command[CogT@GroupMixin, ..., Any] | None"
+       Type "Command[CogT@GroupMixin, ..., Any]" is not assignable to type "Command[CogT@GroupMixin, ..., Any] | None"
+         "steam.ext.commands.commands.Command" is not assignable to "steam.ext.commands.commands.Command"
+           Type parameter "CogT@Command" is covariant, but "CogT@GroupMixin" is not a subtype of "CogT@GroupMixin"
+             Type "CogT@GroupMixin" is not assignable to type "CogT@GroupMixin"
+         "Command[CogT@GroupMixin, ..., Any]" is not assignable to "None" (reportReturnType)
+   /tmp/mypy_primer/projects/steam.py/steam/ext/commands/commands.py:732:41 - warning: Unnecessary "# type: ignore" comment (reportUnnecessaryTypeIgnoreComment)

... (truncated 2 lines) ...

psycopg (https:/psycopg/psycopg)
+   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/connection.py:249:20 - error: Type "Cursor[Row@Connection]" is not assignable to return type "Cursor[Row@Connection]"
+     "psycopg.psycopg.cursor.Cursor" is not assignable to "psycopg.psycopg.cursor.Cursor"
+       Type parameter "Row@Cursor" is covariant, but "Row@Connection" is not a subtype of "Row@Connection"
+         Type "Row@Connection" is not assignable to type "Row@Connection" (reportReturnType)
+ /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/cursor.py
+   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/cursor.py:69:16 - error: Type "RowFactory[Row@Cursor] | RowFactory[Any]" is not assignable to return type "RowFactory[Row@Cursor]"
+     Type "RowFactory[Row@Cursor] | RowFactory[Any]" is not assignable to type "RowFactory[Row@Cursor]"
+       "psycopg.psycopg.rows.RowFactory" is not assignable to "psycopg.psycopg.rows.RowFactory"
+         Type parameter "Row@RowFactory" is covariant, but "Row@Cursor" is not a subtype of "Row@Cursor"
+           Type "Row@Cursor" is not assignable to type "Row@Cursor" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/cursor.py:78:16 - error: Type "RowMaker[Row@Cursor] | RowMaker[Any]" is not assignable to return type "RowMaker[Row@Cursor]"
+     Type "RowMaker[Row@Cursor] | RowMaker[Any]" is not assignable to type "RowMaker[Row@Cursor]"
+       "psycopg.psycopg.rows.RowMaker" is not assignable to "psycopg.psycopg.rows.RowMaker"
+         Type parameter "Row@RowMaker" is covariant, but "Row@Cursor" is not a subtype of "Row@Cursor"
+           Type "Row@Cursor" is not assignable to type "Row@Cursor" (reportReturnType)
+ /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/cursor_async.py
+   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/cursor_async.py:69:16 - error: Type "AsyncRowFactory[Row@AsyncCursor] | AsyncRowFactory[Any]" is not assignable to return type "AsyncRowFactory[Row@AsyncCursor]"
+     Type "AsyncRowFactory[Row@AsyncCursor] | AsyncRowFactory[Any]" is not assignable to type "AsyncRowFactory[Row@AsyncCursor]"
+       "psycopg.psycopg.rows.AsyncRowFactory" is not assignable to "psycopg.psycopg.rows.AsyncRowFactory"
+         Type parameter "Row@AsyncRowFactory" is covariant, but "Row@AsyncCursor" is not a subtype of "Row@AsyncCursor"
+           Type "Row@AsyncCursor" is not assignable to type "Row@AsyncCursor" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/cursor_async.py:78:16 - error: Type "RowMaker[Row@AsyncCursor] | RowMaker[Any]" is not assignable to return type "RowMaker[Row@AsyncCursor]"
+     Type "RowMaker[Row@AsyncCursor] | RowMaker[Any]" is not assignable to type "RowMaker[Row@AsyncCursor]"
+       "psycopg.psycopg.rows.RowMaker" is not assignable to "psycopg.psycopg.rows.RowMaker"
+         Type parameter "Row@RowMaker" is covariant, but "Row@AsyncCursor" is not a subtype of "Row@AsyncCursor"
+           Type "Row@AsyncCursor" is not assignable to type "Row@AsyncCursor" (reportReturnType)
-   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/server_cursor.py:249:13 - error: Argument of type "Self@ServerCursor[Row@ServerCursor]" cannot be assigned to parameter "self" of type "Cursor[TupleRow]" in function "__init__"
-     "ServerCursor[Row@ServerCursor]*" is not assignable to "Cursor[TupleRow]"
-       Type parameter "Row@Cursor" is covariant, but "Row@ServerCursor" is not a subtype of "TupleRow"
-         "object*" is not assignable to "Tuple[Any, ...]" (reportArgumentType)
-   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/server_cursor.py:251:36 - error: Argument of type "Self@ServerCursor[Row@ServerCursor]" cannot be assigned to parameter "self" of type "ServerCursorMixin[Unknown, TupleRow]" in function "__init__"
-     "ServerCursor[Row@ServerCursor]*" is not assignable to "ServerCursorMixin[Unknown, TupleRow]"
-       Type parameter "Row@ServerCursorMixin" is covariant, but "Row@ServerCursor" is not a subtype of "TupleRow"
-         "object*" is not assignable to "Tuple[Any, ...]" (reportArgumentType)
-   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/server_cursor.py:388:13 - error: Argument of type "Self@AsyncServerCursor[Row@AsyncServerCursor]" cannot be assigned to parameter "self" of type "AsyncCursor[TupleRow]" in function "__init__"
-     "AsyncServerCursor[Row@AsyncServerCursor]*" is not assignable to "AsyncCursor[TupleRow]"
-       Type parameter "Row@AsyncCursor" is covariant, but "Row@AsyncServerCursor" is not a subtype of "TupleRow"
-         "object*" is not assignable to "Tuple[Any, ...]" (reportArgumentType)
-   /tmp/mypy_primer/projects/psycopg/psycopg/psycopg/server_cursor.py:390:36 - error: Argument of type "Self@AsyncServerCursor[Row@AsyncServerCursor]" cannot be assigned to parameter "self" of type "ServerCursorMixin[Unknown, TupleRow]" in function "__init__"
-     "AsyncServerCursor[Row@AsyncServerCursor]*" is not assignable to "ServerCursorMixin[Unknown, TupleRow]"
-       Type parameter "Row@ServerCursorMixin" is covariant, but "Row@AsyncServerCursor" is not a subtype of "TupleRow"
-         "object*" is not assignable to "Tuple[Any, ...]" (reportArgumentType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool.py:171:23 - error: Return type of generator function must be compatible with "Generator[CT@ConnectionPool, Any, Any]"
+     Type "CT@ConnectionPool" is not assignable to type "CT@ConnectionPool" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool.py:216:24 - error: Type "CT@ConnectionPool" is not assignable to return type "CT@ConnectionPool"
+     Type "CT@ConnectionPool" is not assignable to type "CT@ConnectionPool" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool.py:262:16 - error: Type "CT@ConnectionPool" is not assignable to return type "CT@ConnectionPool"
+     Type "CT@ConnectionPool" is not assignable to type "CT@ConnectionPool" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool.py:851:20 - error: Type "CT@WaitingClient" is not assignable to return type "CT@WaitingClient"
+     Type "CT@WaitingClient" is not assignable to type "CT@WaitingClient" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool_async.py:194:23 - error: Return type of async generator function must be compatible with "AsyncGenerator[ACT@AsyncConnectionPool, Any]"
+     Type "ACT@AsyncConnectionPool" is not assignable to type "ACT@AsyncConnectionPool" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool_async.py:240:24 - error: Type "ACT@AsyncConnectionPool" is not assignable to return type "ACT@AsyncConnectionPool"
+     Type "ACT@AsyncConnectionPool" is not assignable to type "ACT@AsyncConnectionPool" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool_async.py:286:16 - error: Type "ACT@AsyncConnectionPool" is not assignable to return type "ACT@AsyncConnectionPool"
+     Type "ACT@AsyncConnectionPool" is not assignable to type "ACT@AsyncConnectionPool" (reportReturnType)
+   /tmp/mypy_primer/projects/psycopg/psycopg_pool/psycopg_pool/pool_async.py:908:20 - error: Type "ACT@WaitingClient" is not assignable to return type "ACT@WaitingClient"
+     Type "ACT@WaitingClient" is not assignable to type "ACT@WaitingClient" (reportReturnType)
- 1846 errors, 108 warnings, 0 informations 
+ 1855 errors, 108 warnings, 0 informations 

sympy (https:/sympy/sympy)
-   /tmp/mypy_primer/projects/sympy/sympy/core/numbers.py:4123:16 - error: Operator "%" not supported for types "Basic | Unknown" and "Literal[2]"
+   /tmp/mypy_primer/projects/sympy/sympy/core/numbers.py:4123:16 - error: Operator "%" not supported for types "Unknown | Basic" and "Literal[2]"

bokeh (https:/bokeh/bokeh)
-   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:32:45 - error: Argument of type "str | int" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
+   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:32:45 - error: Argument of type "int | str" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
-     Type "str | int" is not assignable to type "ID | None"
+     Type "int | str" is not assignable to type "ID | None"
-   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:35:47 - error: Argument of type "str | int" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
+   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:35:47 - error: Argument of type "int | str" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
-     Type "str | int" is not assignable to type "ID | None"
+     Type "int | str" is not assignable to type "ID | None"
-   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:39:42 - error: Argument of type "str | int" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
+   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:39:42 - error: Argument of type "int | str" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
-     Type "str | int" is not assignable to type "ID | None"
+     Type "int | str" is not assignable to type "ID | None"
-   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:42:41 - error: Argument of type "str | int" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
+   /tmp/mypy_primer/projects/bokeh/examples/plotting/scatter_selection.py:42:41 - error: Argument of type "int | str" cannot be assigned to parameter "id" of type "ID | None" in function "__new__"
-     Type "str | int" is not assignable to type "ID | None"
+     Type "int | str" is not assignable to type "ID | None"

trio (https:/python-trio/trio)
+   /tmp/mypy_primer/projects/trio/src/trio/_core/_tests/test_run.py:130:22 - error: Argument type is partially unknown
+     Argument corresponds to parameter "exception" in function "__init__"
+     Argument type is "Matcher[Unknown]" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/trio/src/trio/_core/_tests/test_run.py:141:22 - error: Argument type is partially unknown
+     Argument corresponds to parameter "exception" in function "__init__"
+     Argument type is "Matcher[Unknown]" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/trio/src/trio/_tests/test_highlevel_serve_listeners.py:123:26 - error: Argument type is partially unknown
+     Argument corresponds to parameter "exception" in function "__init__"
+     Argument type is "Matcher[Unknown]" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/trio/src/trio/_tests/test_testing_raisesgroup.py:127:9 - error: Argument type is partially unknown
+     Argument corresponds to parameter "exception" in function "__init__"
+     Argument type is "Matcher[Unknown]" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/trio/src/trio/_tests/test_testing_raisesgroup.py:336:22 - error: Argument type is partially unknown
+     Argument corresponds to parameter "exception" in function "__init__"
+     Argument type is "Matcher[Unknown]" (reportUnknownArgumentType)
- 3911 errors, 53 warnings, 0 informations 
+ 3916 errors, 53 warnings, 0 informations 

core (https:/home-assistant/core)
+   /tmp/mypy_primer/projects/core/homeassistant/data_entry_flow.py:245:16 - error: Type "_FlowResultT@FlowManager" is not assignable to return type "_FlowResultT@FlowManager"
+     Type "_FlowResultT@FlowManager" is not assignable to type "_FlowResultT@FlowManager" (reportReturnType)
+   /tmp/mypy_primer/projects/core/homeassistant/data_entry_flow.py:279:16 - error: Type "list[_FlowResultT@FlowManager]" is not assignable to return type "list[_FlowResultT@FlowManager]"
+     "builtins.list" is not assignable to "builtins.list"
+       Type parameter "_T@list" is invariant, but "_FlowResultT@FlowManager" is not the same as "_FlowResultT@FlowManager"
+       Consider switching from "list" to "Sequence" which is covariant (reportReturnType)
+   /tmp/mypy_primer/projects/core/homeassistant/data_entry_flow.py:300:16 - error: Type "list[FlowHandler[_FlowResultT@FlowManager, _HandlerT@FlowManager]]" is not assignable to return type "list[FlowHandler[_FlowResultT@FlowManager, _HandlerT@FlowManager]]" (reportReturnType)
+   /tmp/mypy_primer/projects/core/homeassistant/data_entry_flow.py:331:16 - error: Type "_FlowResultT@FlowManager" is not assignable to return type "_FlowResultT@FlowManager"
+     Type "_FlowResultT@FlowManager" is not assignable to type "_FlowResultT@FlowManager" (reportReturnType)
+   /tmp/mypy_primer/projects/core/homeassistant/data_entry_flow.py:351:22 - error: Type "_FlowResultT@FlowManager" is not assignable to declared type "_FlowResultT@FlowManager | None"
+     Type "_FlowResultT@FlowManager" is not assignable to type "_FlowResultT@FlowManager | None"
+       Type "_FlowResultT@FlowManager" is not assignable to type "_FlowResultT@FlowManager"
+       "FlowResult[Any]*" is not assignable to "None" (reportAssignmentType)
+   /tmp/mypy_primer/projects/core/homeassistant/data_entry_flow.py:355:16 - error: Type "_FlowResultT@FlowManager | None" is not assignable to return type "_FlowResultT@FlowManager"
+     Type "_FlowResultT@FlowManager | None" is not assignable to type "_FlowResultT@FlowManager" (reportReturnType)
+   /tmp/mypy_primer/projects/core/homeassistant/data_entry_flow.py:446:16 - error: Type "_FlowResultT@FlowManager" is not assignable to return type "_FlowResultT@FlowManager"
+     Type "_FlowResultT@FlowManager" is not assignable to type "_FlowResultT@FlowManager" (reportReturnType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/number.py:127:57 - error: Argument of type "RingDeviceT@RingNumber" cannot be assigned to parameter of type "RingDeviceT@RingNumber"
+     Type "RingDeviceT@RingNumber" is not assignable to type "RingDeviceT@RingNumber" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/number.py:147:49 - error: Argument of type "RingDeviceT@RingNumber" cannot be assigned to parameter of type "RingDeviceT@RingNumber"
+     Type "RingDeviceT@RingNumber" is not assignable to type "RingDeviceT@RingNumber" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/sensor.py:88:68 - error: Argument of type "RingDeviceT@RingSensor" cannot be assigned to parameter of type "RingDeviceT@RingSensor"
+     Type "RingDeviceT@RingSensor" is not assignable to type "RingDeviceT@RingSensor" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/siren.py:120:53 - error: Argument of type "RingDeviceT@RingSiren" cannot be assigned to parameter of type "RingDeviceT@RingSiren"
+     Type "RingDeviceT@RingSiren" is not assignable to type "RingDeviceT@RingSiren" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/siren.py:133:54 - error: Argument of type "RingDeviceT@RingSiren" cannot be assigned to parameter of type "RingDeviceT@RingSiren"
+     Type "RingDeviceT@RingSiren" is not assignable to type "RingDeviceT@RingSiren" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/siren.py:135:55 - error: Argument of type "RingDeviceT@RingSiren" cannot be assigned to parameter of type "RingDeviceT@RingSiren"
+     Type "RingDeviceT@RingSiren" is not assignable to type "RingDeviceT@RingSiren" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/switch.py:137:54 - error: Argument of type "RingDeviceT@RingSwitch" cannot be assigned to parameter of type "RingDeviceT@RingSwitch"
+     Type "RingDeviceT@RingSwitch" is not assignable to type "RingDeviceT@RingSwitch" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/components/ring/switch.py:139:55 - error: Argument of type "RingDeviceT@RingSwitch" cannot be assigned to parameter of type "RingDeviceT@RingSwitch"
+     Type "RingDeviceT@RingSwitch" is not assignable to type "RingDeviceT@RingSwitch" (reportArgumentType)
+   /tmp/mypy_primer/projects/core/homeassistant/helpers/entity_component.py:215:16 - error: Type "list[_EntityT@EntityComponent]" is not assignable to return type "list[_EntityT@EntityComponent]"
+     "builtins.list" is not assignable to "builtins.list"
+       Type parameter "_T@list" is invariant, but "_EntityT@EntityComponent" is not the same as "_EntityT@EntityComponent"
+       Consider switching from "list" to "Sequence" which is covariant (reportReturnType)
- 22229 errors, 346 warnings, 0 informations 
+ 22245 errors, 346 warnings, 0 informations 

hydra-zen (https:/mit-ll-responsible-ai/hydra-zen)
+   /tmp/mypy_primer/projects/hydra-zen/src/hydra_zen/structured_configs/_implementations.py:2601:34 - error: Cannot access attribute "__fields__" for class "type[BuildsWithSig[Importable@builds, Any]]"
+     Attribute "__fields__" is unknown (reportAttributeAccessIssue)
+   /tmp/mypy_primer/projects/hydra-zen/src/hydra_zen/structured_configs/_implementations.py:2601:34 - error: Cannot access attribute "__fields__" for class "type[BuildsWithSig[type[R@builds], P@builds]]"
+     Attribute "__fields__" is unknown (reportAttributeAccessIssue)
- 172 errors, 15 warnings, 183 informations 
+ 174 errors, 15 warnings, 183 informations 

xarray-dataclasses (https:/astropenguin/xarray-dataclasses)
+   /tmp/mypy_primer/projects/xarray-dataclasses/xarray_dataclasses/datamodel.py:216:28 - error: Argument of type "type[<subclass of DataClass[PInit@eval_dataclass] and DataclassInstance>] | <subclass of type[DataClass[PInit@eval_dataclass]] and DataclassInstance> | <subclass of DataClass[PInit@eval_dataclass] and type[DataclassInstance]>" cannot be assigned to parameter "obj" of type "(...) -> Any" in function "get_type_hints"
+     Type "type[<subclass of DataClass[PInit@eval_dataclass] and DataclassInstance>] | <subclass of type[DataClass[PInit@eval_dataclass]] and DataclassInstance> | <subclass of DataClass[PInit@eval_dataclass] and type[DataclassInstance]>" is not assignable to type "(...) -> Any"
+       Type "<subclass of DataClass[PInit@eval_dataclass] and type[DataclassInstance]>" is not assignable to type "(...) -> Any" (reportArgumentType)
- 55 errors, 160 warnings, 0 informations 
+ 56 errors, 160 warnings, 0 informations 

@erictraut erictraut merged commit 107cdbe into main Oct 8, 2024
18 checks passed
@erictraut erictraut deleted the issue-9109 branch October 8, 2024 01:46
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