Added test cases for #6261 and fixed a bug found by test.#6332
Merged
Added test cases for #6261 and fixed a bug found by test.#6332
Conversation
Contributor
|
Diff from mypy_primer, showing the effect of this PR on open source code: pydantic (https://github.com/samuelcolvin/pydantic)
+ /tmp/mypy_primer/projects/pydantic/pydantic/fields.py:304:24 - error: Expression of type "FieldInfo" cannot be assigned to return type "Self@FieldInfo"
+ Type "FieldInfo" cannot be assigned to type "Self@FieldInfo" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pydantic/pydantic/fields.py:368:20 - error: Expression of type "FieldInfo" cannot be assigned to return type "Self@FieldInfo"
+ Type "FieldInfo" cannot be assigned to type "Self@FieldInfo" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/pydantic/pydantic/fields.py:381:24 - error: Expression of type "FieldInfo" cannot be assigned to return type "Self@FieldInfo"
+ Type "FieldInfo" cannot be assigned to type "Self@FieldInfo" (reportGeneralTypeIssues)
- 57 errors, 0 warnings, 0 informations
+ 60 errors, 0 warnings, 0 informations
steam.py (https://github.com/Gobot1234/steam.py)
+ /tmp/mypy_primer/projects/steam.py/steam/channel.py
+ /tmp/mypy_primer/projects/steam.py/steam/channel.py:102:33 - error: Argument of type "Group" cannot be assigned to parameter "chat_group" of type "ChatGroup[Any, Self@GroupChannel, Literal[Type.Clan, Type.Chat]]" in function "__init__"
+ "Group" is incompatible with "ChatGroup[Any, Self@GroupChannel, Literal[Type.Clan, Type.Chat]]"
+ Type parameter "ChatT@ChatGroup" is covariant, but "GroupChannel" is not a subtype of "Self@GroupChannel"
+ Type "GroupChannel" cannot be assigned to type "Self@GroupChannel" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/channel.py:112:33 - error: Argument of type "Clan" cannot be assigned to parameter "chat_group" of type "ChatGroup[Any, Self@ClanChannel, Literal[Type.Clan, Type.Chat]]" in function "__init__"
+ "Clan" is incompatible with "ChatGroup[Any, Self@ClanChannel, Literal[Type.Clan, Type.Chat]]"
+ Type parameter "ChatT@ChatGroup" is covariant, but "ClanChannel" is not a subtype of "Self@ClanChannel"
+ Type "ClanChannel" cannot be assigned to type "Self@ClanChannel" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:245:27 - error: Cannot access member "_location" for type "Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat]*"
+ Failed to call method "__get__" for descriptor class "CachedSlotProperty[Self@Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat], tuple[ChatGroupID, ChatID]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:245:14 - error: Type of "_location" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:251:27 - error: Cannot access member "_location" for type "Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat]*"
+ Failed to call method "__get__" for descriptor class "CachedSlotProperty[Self@Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat], tuple[ChatGroupID, ChatID]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:251:14 - error: Type of "_location" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:293:27 - error: Cannot access member "_location" for type "Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat]*"
+ Failed to call method "__get__" for descriptor class "CachedSlotProperty[Self@Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat], tuple[ChatGroupID, ChatID]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:293:14 - error: Type of "_location" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:294:13 - error: Expected 5 positional arguments (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:295:13 - error: Expected 5 positional arguments (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:296:13 - error: Expected 5 positional arguments (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:320:58 - error: Cannot access member "_location" for type "Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat]*"
+ Failed to call method "__get__" for descriptor class "CachedSlotProperty[Self@Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat], tuple[ChatGroupID, ChatID]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:320:45 - error: Type of "_location" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:320:69 - error: Expected 3 positional arguments (reportGeneralTypeIssues)
- /tmp/mypy_primer/projects/steam.py/steam/chat.py:596:16 - error: Expression of type "MemberT@ChatGroup" cannot be assigned to return type "MemberT@ChatGroup"
- Type "MemberT@ChatGroup" cannot be assigned to type "MemberT@ChatGroup" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:404:32 - error: Cannot access member "_type_args" for type "Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat]"
+ Failed to call method "__get__" for descriptor class "classproperty[type[Self@Chat[ChatMessageT@Chat, ClanT@Chat, GroupT@Chat]], tuple[type[ChatMessageT@Chat], type[ClanT@Chat], type[GroupT@Chat]]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:404:27 - error: Type of "_type_args" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:415:32 - error: Type of "created_at" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:645:33 - error: Cannot access member "_type_args" for type "ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]"
+ Failed to call method "__get__" for descriptor class "classproperty[type[Self@ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]], tuple[type[MemberT@ChatGroup], type[ChatT@ChatGroup], type[ChatGroupTypeT@ChatGroup]]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:645:28 - error: Type of "_type_args" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:591:33 - error: Cannot access member "_type_args" for type "ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]"
+ Failed to call method "__get__" for descriptor class "classproperty[type[Self@ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]], tuple[type[MemberT@ChatGroup], type[ChatT@ChatGroup], type[ChatGroupTypeT@ChatGroup]]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:591:28 - error: Type of "_type_args" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:610:31 - error: Cannot access member "_type_args" for type "ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]"
+ Failed to call method "__get__" for descriptor class "classproperty[type[Self@ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]], tuple[type[MemberT@ChatGroup], type[ChatT@ChatGroup], type[ChatGroupTypeT@ChatGroup]]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:610:26 - error: Type of "_type_args" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:616:32 - error: Type of "id" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:690:37 - error: Cannot access member "_type_args" for type "ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]"
+ Failed to call method "__get__" for descriptor class "classproperty[type[Self@ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]], tuple[type[MemberT@ChatGroup], type[ChatT@ChatGroup], type[ChatGroupTypeT@ChatGroup]]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:690:32 - error: Type of "_type_args" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:698:33 - error: Cannot access member "_type_args" for type "ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]"
+ Failed to call method "__get__" for descriptor class "classproperty[type[Self@ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]], tuple[type[MemberT@ChatGroup], type[ChatT@ChatGroup], type[ChatGroupTypeT@ChatGroup]]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:698:28 - error: Type of "_type_args" is unknown (reportUnknownMemberType)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:871:31 - error: Cannot access member "_type_args" for type "ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]"
+ Failed to call method "__get__" for descriptor class "classproperty[type[Self@ChatGroup[MemberT@ChatGroup, ChatT@ChatGroup, ChatGroupTypeT@ChatGroup]], tuple[type[MemberT@ChatGroup], type[ChatT@ChatGroup], type[ChatGroupTypeT@ChatGroup]]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/chat.py:871:26 - error: Type of "_type_args" is unknown (reportUnknownMemberType)
- /tmp/mypy_primer/projects/steam.py/steam/chat.py:201:31 - warning: Unnecessary "# type: ignore" comment
+ /tmp/mypy_primer/projects/steam.py/steam/clan.py:310:24 - error: Expression of type "Announcement[PartialClan]" cannot be assigned to return type "Announcement[Self@PartialClan]"
+ "Announcement[PartialClan]" is incompatible with "Announcement[Self@PartialClan]"
+ Type parameter "ClanT@Announcement" is covariant, but "PartialClan" is not a subtype of "Self@PartialClan"
+ Type "PartialClan" cannot be assigned to type "Self@PartialClan" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/enums.py:252:24 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
+ Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/enums.py:259:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
+ Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/enums.py:261:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
+ Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/enums.py:267:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
+ Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/steam.py/steam/enums.py:269:20 - error: Expression of type "Flags" cannot be assigned to return type "Self@Flags"
+ Type "Flags" cannot be assigned to type "Self@Flags" (reportGeneralTypeIssues)
... (truncated 67 lines) ...
discord.py (https://github.com/Rapptz/discord.py)
+ /tmp/mypy_primer/projects/discord.py/discord/abc.py
+ /tmp/mypy_primer/projects/discord.py/discord/abc.py:975:16 - error: Expression of type "GuildChannel" cannot be assigned to return type "Self@GuildChannel"
+ Type "GuildChannel" cannot be assigned to type "Self@GuildChannel" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/asset.py:423:16 - error: Expression of type "Asset" cannot be assigned to return type "Self@Asset"
+ Type "Asset" cannot be assigned to type "Self@Asset" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/asset.py:451:16 - error: Expression of type "Asset" cannot be assigned to return type "Self@Asset"
+ Type "Asset" cannot be assigned to type "Self@Asset" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/asset.py:486:16 - error: Expression of type "Asset" cannot be assigned to return type "Self@Asset"
+ Type "Asset" cannot be assigned to type "Self@Asset" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/automod.py
+ /tmp/mypy_primer/projects/discord.py/discord/automod.py:412:61 - error: Cannot access member "actions" for type "AutoModRule"
+ Failed to call method "__get__" for descriptor class "CachedSlotProperty[Self@AutoModRule, List[AutoModRuleAction]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/automod.py:544:16 - error: Expression of type "AutoModRule" cannot be assigned to return type "Self@AutoModRule"
+ Type "AutoModRule" cannot be assigned to type "Self@AutoModRule" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/client.py:288:14 - error: Cannot assign member "_connection" for type "Client"
+ Expression of type "ConnectionState[Client]" cannot be assigned to member "_connection" of class "Client"
+ "ConnectionState[Client]" is incompatible with "ConnectionState[Self@Client]"
+ Type parameter "ClientT@ConnectionState" is covariant, but "Client" is not a subtype of "Self@Client"
+ Type "Client" cannot be assigned to type "Self@Client" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/colour.py
+ /tmp/mypy_primer/projects/discord.py/discord/colour.py:203:20 - error: Expression of type "Colour" cannot be assigned to return type "Self@Colour"
+ Type "Colour" cannot be assigned to type "Self@Colour" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/colour.py:209:24 - error: Expression of type "Colour" cannot be assigned to return type "Self@Colour"
+ Type "Colour" cannot be assigned to type "Self@Colour" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/colour.py:210:20 - error: Expression of type "Colour" cannot be assigned to return type "Self@Colour"
+ Type "Colour" cannot be assigned to type "Self@Colour" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/colour.py:214:20 - error: Expression of type "Colour" cannot be assigned to return type "Self@Colour"
+ Type "Colour" cannot be assigned to type "Self@Colour" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/embeds.py
+ /tmp/mypy_primer/projects/discord.py/discord/embeds.py:252:16 - error: Expression of type "Embed" cannot be assigned to return type "Self@Embed"
+ Type "Embed" cannot be assigned to type "Self@Embed" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/interactions.py:582:25 - error: Cannot access member "command" for type "Interaction[ClientT@Interaction]"
+ Failed to call method "__get__" for descriptor class "CachedSlotProperty[Self@Interaction[ClientT@Interaction], Command[Any, ..., Any] | ContextMenu | None]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/message.py
+ /tmp/mypy_primer/projects/discord.py/discord/message.py:1912:65 - error: Cannot access member "raw_channel_mentions" for type "Message"
+ Failed to call method "__get__" for descriptor class "CachedSlotProperty[Self@Message, List[int]]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/welcome_screen.py
+ /tmp/mypy_primer/projects/discord.py/discord/welcome_screen.py:217:16 - error: Expression of type "WelcomeScreen" cannot be assigned to return type "Self@WelcomeScreen"
+ Type "WelcomeScreen" cannot be assigned to type "Self@WelcomeScreen" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/app_commands/checks.py
+ /tmp/mypy_primer/projects/discord.py/discord/app_commands/checks.py:189:16 - error: Expression of type "Cooldown" cannot be assigned to return type "Self@Cooldown"
+ Type "Cooldown" cannot be assigned to type "Self@Cooldown" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/cooldowns.py
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/cooldowns.py:251:16 - error: Expression of type "MaxConcurrency" cannot be assigned to return type "Self@MaxConcurrency"
+ Type "MaxConcurrency" cannot be assigned to type "Self@MaxConcurrency" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/core.py:618:48 - error: Argument of type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to parameter "other" of type "Self@Command[CogT@Command, P@Command, T@Command]" in function "_ensure_assignment_on_copy"
+ Type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to type "Self@Command[CogT@Command, P@Command, T@Command]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/core.py:625:52 - error: Argument of type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to parameter "other" of type "Self@Command[CogT@Command, P@Command, T@Command]" in function "_ensure_assignment_on_copy"
+ Type "Command[CogT@Command, P@Command, T@Command]" cannot be assigned to type "Self@Command[CogT@Command, P@Command, T@Command]" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/help.py
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/help.py:377:16 - error: Expression of type "HelpCommand" cannot be assigned to return type "Self@HelpCommand"
+ Type "HelpCommand" cannot be assigned to type "Self@HelpCommand" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/parameters.py
+ /tmp/mypy_primer/projects/discord.py/discord/ext/commands/parameters.py:138:16 - error: Expression of type "Parameter" cannot be assigned to return type "Self@Parameter"
+ Type "Parameter" cannot be assigned to type "Self@Parameter" (reportGeneralTypeIssues)
+ /tmp/mypy_primer/projects/discord.py/discord/ui/select.py:355:16 - error: Expression of type "BaseSelect[Any]" cannot be assigned to return type "Self@BaseSelect[V@BaseSelect]"
+ Type "BaseSelect[Any]" cannot be assigned to type "Self@BaseSelect[V@BaseSelect]" (reportGeneralTypeIssues)
- 47 errors, 9 warnings, 0 informations
+ 69 errors, 9 warnings, 0 informations
pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ /tmp/mypy_primer/projects/pandas-stubs/pandas-stubs/core/indexes/multi.pyi:156:9 - error: Method "intersection" overrides class "Index" in an incompatible manner
+ Parameter 2 type mismatch: base parameter is type "list[Any] | MultiIndex", override parameter is type "list[Any] | Self@Index[S1@Index]" (reportIncompatibleMethodOverride)
- 1327 errors, 0 warnings, 0 informations
+ 1328 errors, 0 warnings, 0 informations
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.