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

TEST: Add foundation for TypeVar defaults (PEP 696) #10

Open
wants to merge 4 commits into
base: my-main
Choose a base branch
from

Conversation

cdce8p
Copy link
Owner

@cdce8p cdce8p commented Mar 10, 2023

No description provided.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@cdce8p cdce8p force-pushed the TypeVar-basic branch 2 times, most recently from afa2f6b to c3cc492 Compare March 10, 2023 17:56
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

1 similar comment
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@cdce8p cdce8p force-pushed the TypeVar-basic branch 2 times, most recently from 76e5022 to b2f0290 Compare May 2, 2023 14:59
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Copy link

github-actions bot commented Feb 1, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@cdce8p cdce8p force-pushed the TypeVar-basic branch 2 times, most recently from bc3f6c0 to 7669058 Compare February 1, 2024 21:07
Copy link

github-actions bot commented Feb 1, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@cdce8p cdce8p force-pushed the TypeVar-basic branch 2 times, most recently from 14d7a77 to 2157b93 Compare February 2, 2024 10:19
Copy link

github-actions bot commented Feb 2, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link

github-actions bot commented Feb 2, 2024

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

steam.py (https://github.com/Gobot1234/steam.py)
- steam/badge.py:129: error: Argument 1 to "inventory" of "PartialUser" has incompatible type "tuple[str, int]"; expected "App[str]"  [arg-type]
+ steam/badge.py:129: error: Argument 1 to "inventory" of "PartialUser" has incompatible type "tuple[str, int]"; expected "App[str | None]"  [arg-type]
- steam/app.py:696: error: Argument 2 to "AppStats" has incompatible type "PartialApp[NameT]"; expected "App[str]"  [arg-type]
- steam/app.py:710: error: Argument 2 to "AppAchievement" has incompatible type "PartialApp[NameT]"; expected "PartialApp[str]"  [arg-type]
- steam/app.py:724: error: Type argument "Self" of "Leaderboard" must be a subtype of "App[str]"  [type-var]
- steam/app.py:736: error: Value of type variable "AppT" of "Leaderboard" cannot be "Self"  [type-var]
- steam/app.py:749: error: Type argument "Self" of "Leaderboard" must be a subtype of "App[str]"  [type-var]
- steam/app.py:765: error: Value of type variable "AppT" of "Leaderboard" cannot be "Self"  [type-var]
- steam/app.py:775: error: Type argument "Self" of "Leaderboard" must be a subtype of "App[str]"  [type-var]
- steam/app.py:786: error: Value of type variable "AppT" of "Leaderboard" cannot be "Self"  [type-var]
- steam/app.py:832: error: Argument 1 to "fetch_review" of "PartialUser" has incompatible type "PartialApp[NameT]"; expected "App[str]"  [arg-type]
- steam/app.py:1169: error: Type argument "Self" of "CommunityItem" must be a subtype of "PartialApp[str]"  [type-var]
- steam/app.py:1181: error: Value of type variable "AppT" of "CommunityItem" cannot be "Self"  [type-var]
- steam/app.py:1230: error: Type argument "Self" of "RewardItem" must be a subtype of "PartialApp[str]"  [type-var]
- steam/app.py:1240: error: Value of type variable "AppT" of "RewardItem" cannot be "Self"  [type-var]
- steam/app.py:1271: error: Value of type variable "AppT" of "AppBadge" cannot be "Self"  [type-var]
- steam/app.py:1300: error: Type argument "Self" of "RewardItem" must be a subtype of "PartialApp[str]"  [type-var]
- steam/app.py:1305: error: Type argument "Self" of "AppBadge" must be a subtype of "PartialApp[str]"  [type-var]
- steam/app.py:1316: error: Value of type variable "AppT" of "AppBadge" cannot be "Self"  [type-var]
- steam/app.py:1374: error: Argument 1 to "temporarily_play" of "ConnectionState" has incompatible type "PartialApp[NameT]"; expected "App[str]"  [arg-type]
- steam/profile.py:152: error: Argument 1 to "inventory" of "PartialUser" has incompatible type "tuple[str, int]"; expected "App[str]"  [arg-type]
+ steam/profile.py:152: error: Argument 1 to "inventory" of "PartialUser" has incompatible type "tuple[str, int]"; expected "App[str | None]"  [arg-type]
- steam/event.py:277: error: Incompatible types in assignment (expression has type "App[str] | PartialApp[str | None] | None", variable has type "PartialApp[str | None] | None")  [assignment]
+ steam/event.py:277: error: Incompatible types in assignment (expression has type "App[str | None] | None", variable has type "PartialApp[str | None] | None")  [assignment]
- steam/user_news.py:112: error: Argument 1 to "fetch_review" of "PartialUser" has incompatible type "PartialApp[str | None]"; expected "App[str]"  [arg-type]
- steam/ext/commands/commands.py:288: error: Incompatible types in assignment (expression has type "GroupMixin[Any] | Group[Any, [VarArg(Any), KwArg(Any)], Any] | None", variable has type "Self")  [assignment]
+ steam/ext/commands/commands.py:288: error: Incompatible types in assignment (expression has type "GroupMixin[Any | None] | Group[Any, [VarArg(Any), KwArg(Any)], Any] | None", variable has type "Self")  [assignment]
- steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str], *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str | None], *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str | None], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/csgo/models.py:179: note:          def inventory(self, App[str], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/csgo/models.py:179: note:          def inventory(self, App[str | None], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str | None], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/csgo/models.py:179: note:          def inventory(self, App[str], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/csgo/models.py:179: note:          def inventory(self, App[str | None], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/csgo/models.py:179: note:          def inventory(self, app: App[str | None], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str], *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str | None], *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str | None], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/tf2/client.py:36: note:          def inventory(self, App[str], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/tf2/client.py:36: note:          def inventory(self, App[str | None], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str | None], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/tf2/client.py:36: note:          def inventory(self, App[str], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/tf2/client.py:36: note:          def inventory(self, App[str | None], /, *, context_id: int | None = ..., language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
- steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]
+ steam/ext/tf2/client.py:36: note:          def inventory(self, app: App[str | None], *, language: Language | None = ...) -> Coroutine[Any, Any, Inventory[Item[ClientUser], ClientUser]]

Copy link

github-actions bot commented Feb 2, 2024

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@cdce8p cdce8p force-pushed the TypeVar-basic branch 2 times, most recently from 38f5475 to 403a645 Compare February 3, 2024 17:54
Copy link

github-actions bot commented Feb 6, 2024

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

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/commands.py:699: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [overload-overlap]
+ steam/ext/commands/commands.py:804: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [overload-overlap]
+ steam/ext/commands/commands.py:856: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [overload-overlap]
+ steam/ext/commands/commands.py:865: error: Overloaded function implementation does not accept all possible arguments of signature 3  [misc]
+ steam/ext/commands/commands.py:865: error: Overloaded function implementation cannot produce return type of signature 3  [misc]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/resample.py:257: error: Signature of "pipe" incompatible with supertype "BaseGroupBy"  [override]
+ pandas/core/resample.py:257: note:      Superclass:
+ pandas/core/resample.py:257: note:          @overload
+ pandas/core/resample.py:257: note:          def [P`-1, T] pipe(self, func: Callable[[Resampler, **P], T], *args: P.args, **kwargs: P.args) -> T
+ pandas/core/resample.py:257: note:          @overload
+ pandas/core/resample.py:257: note:          def [T] pipe(self, func: tuple[Callable[..., T], str], *args: Any, **kwargs: Any) -> T
+ pandas/core/resample.py:257: note:      Subclass:
+ pandas/core/resample.py:257: note:          @overload
+ pandas/core/resample.py:257: note:          def [P`-1, T] pipe(self, func: Callable[[Resampler, **P], T], *args: P.args, **kwargs: P.args) -> T
+ pandas/core/resample.py:257: note:          @overload
+ pandas/core/resample.py:257: note:          def [T] pipe(self, func: tuple[Callable[..., T], str], *args: Any, **kwargs: Any) -> T

hydra-zen (https://github.com/mit-ll-responsible-ai/hydra-zen)
+ src/hydra_zen/structured_configs/_implementations.py:479: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 1.9.0+dev.3f03e4cc041ea59fc33456071fedbd3f64ad8d7b
+ src/hydra_zen/structured_configs/_implementations.py:479: : note: use --pdb to drop into pdb
+ src/hydra_zen/typing/_builds_overloads.py:46: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/hydra_zen/typing/_builds_overloads.py:238: error: Overloaded function implementation cannot produce return type of signature 1  [misc]
+ src/hydra_zen/typing/_builds_overloads.py:269: error: Overloaded function signatures 1 and 3 overlap with incompatible return types  [overload-overlap]
+ src/hydra_zen/typing/_builds_overloads.py:472: error: Overloaded function implementation cannot produce return type of signature 1  [misc]
+ src/hydra_zen/typing/_builds_overloads.py:548: error: Overloaded function signatures 3 and 4 overlap with incompatible return types  [overload-overlap]
+ src/hydra_zen/typing/_builds_overloads.py:657: error: Overloaded function implementation cannot produce return type of signature 3  [misc]
- src/hydra_zen/structured_configs/_implementations.py:479: error: Need type annotation for "out"  [var-annotated]
- src/hydra_zen/structured_configs/_implementations.py:629: error: Incompatible types in assignment (expression has type "object", variable has type "type")  [assignment]
- src/hydra_zen/structured_configs/_implementations.py:836: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:843: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:854: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:860: error: The type "type[list[Any]]" is not generic and not indexable  [misc]
- src/hydra_zen/structured_configs/_implementations.py:884: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:891: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:903: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:907: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:915: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:942: error: Incompatible return value type (got "object", expected "type")  [return-value]
- src/hydra_zen/structured_configs/_implementations.py:1043: error: Too many arguments for "object"  [call-arg]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "Literal[False] | None"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "bool"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None | Sequence[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]] | ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]] | Just[Callable[[Callable[..., Any]], Callable[..., Any]]] | type[Builds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[ZenPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[HydraPartialBuilds[Callable[[Callable[..., Any]], Callable[..., Any]]]] | type[Just[Callable[[Callable[..., Any]], Callable[..., Any]]]] | Callable[[Callable[..., Any]], Callable[..., Any]] | str | None]"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "Mapping[str, SupportedPrimitive] | None"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "list[str | DataClass_ | type[DataClass_] | Mapping[str, str | Sequence[str] | None]] | None"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "str | None"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "tuple[type[DataClass_], ...]"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "ZenConvert | None"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1123: error: Argument 2 to "builds" of "BuildsFn" has incompatible type "**dict[str, int | float | Path | DataClass_ | type[DataClass_] | Enum | Any | Sequence[HydraSupportedType] | Mapping[Any, HydraSupportedType] | None]"; expected "T"  [arg-type]
- src/hydra_zen/structured_configs/_implementations.py:1155: error: Incompatible types in assignment (expression has type "Just", variable has type "type[Builds[Any]]")  [assignment]
- src/hydra_zen/structured_configs/_implementations.py:1191: error: Unused "type: ignore" comment  [unused-ignore]
- src/hydra_zen/structured_configs/_implementations.py:1192: error: Unused "type: ignore" comment  [unused-ignore]
- src/hydra_zen/structured_configs/_implementations.py:1193: error: Unused "type: ignore" comment  [unused-ignore]
- src/hydra_zen/structured_configs/_implementations.py:1353: error: Overloaded function signatures 1 and 4 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1353: error: Overloaded function signatures 1 and 5 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1353: error: Overloaded function signatures 1 and 6 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1373: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1373: error: Overloaded function signatures 2 and 5 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1373: error: Overloaded function signatures 2 and 6 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1394: error: Overloaded function signatures 3 and 5 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1394: error: Overloaded function signatures 3 and 6 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1416: error: Overloaded function signatures 4 and 5 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1416: error: Overloaded function signatures 4 and 6 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:1438: error: Overloaded function signatures 5 and 8 overlap with incompatible return types  [overload-overlap]
- src/hydra_zen/structured_configs/_implementations.py:2222: error: "Sequence[str | Builds[Any]]" has no attribute "append"  [attr-defined]

... (truncated 161 lines) ...

discord.py (https://github.com/Rapptz/discord.py)
+ discord/ext/commands/context.py:336: error: Argument 3 to "__call__" of "Command" has incompatible type "**P.kwargs"; expected "P.args"  [arg-type]
- discord/ext/commands/hybrid.py:810: note:          def command(self, name: str = ..., *args: Any, **kwargs: Any) -> Callable[[Callable[[CogT, ContextT, **P], Coroutine[Any, Any, T]] | Callable[[ContextT, **P], Coroutine[Any, Any, T]]], Command[CogT, P, T]]
+ discord/ext/commands/hybrid.py:810: note:          def command(self, name: str = ..., *args: Any, **kwargs: Any) -> Callable[[Callable[[CogT, ContextT, **P], Coroutine[Any, Any, T]] | Callable[[ContextT, **P], Coroutine[Any, Any, T]]], Command[CogT, P.args, T]]
- discord/ext/commands/hybrid.py:834: note:          def group(self, name: str = ..., *args: Any, **kwargs: Any) -> Callable[[Callable[[CogT, ContextT, **P], Coroutine[Any, Any, T]] | Callable[[ContextT, **P], Coroutine[Any, Any, T]]], Group[CogT, P, T]]
+ discord/ext/commands/hybrid.py:834: note:          def group(self, name: str = ..., *args: Any, **kwargs: Any) -> Callable[[Callable[[CogT, ContextT, **P], Coroutine[Any, Any, T]] | Callable[[ContextT, **P], Coroutine[Any, Any, T]]], Group[CogT, P.args, T]]

Copy link

github-actions bot commented Feb 6, 2024

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

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/commands.py:865: error: Overloaded function implementation does not accept all possible arguments of signature 3  [misc]
+ steam/ext/commands/commands.py:865: error: Overloaded function implementation cannot produce return type of signature 3  [misc]

Copy link

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

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/commands.py:851: error: Overloaded function implementation does not accept all possible arguments of signature 3  [misc]
+ steam/ext/commands/commands.py:851: error: Overloaded function implementation cannot produce return type of signature 3  [misc]

1 similar comment
Copy link

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

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/ext/commands/commands.py:851: error: Overloaded function implementation does not accept all possible arguments of signature 3  [misc]
+ steam/ext/commands/commands.py:851: error: Overloaded function implementation cannot produce return type of signature 3  [misc]

Copy link

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Copy link

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

psycopg (https://github.com/psycopg/psycopg)
- Warning: unused section(s) in pyproject.toml: module = ['uvloop']
+ psycopg_pool/psycopg_pool/abc.py:24: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 1.10.0+dev.bf580328084dc424f89eb531299931d2b34e9803
+ psycopg_pool/psycopg_pool/abc.py:24: : note: use --pdb to drop into pdb
+ Traceback (most recent call last):
+   File "", line 8, in <module>
+     sys.exit(console_entry())
+   File "/__main__.py", line 15, in console_entry
+     main()
+   File "/main.py", line 100, in main
+     res, messages, blockers = run_build(sources, options, fscache, t0, stdout, stderr)
+   File "/main.py", line 182, in run_build
+     res = build.build(sources, options, None, flush_errors, fscache, stdout, stderr)
+   File "/build.py", line 192, in build
+     result = _build(
+   File "/build.py", line 266, in _build
+     graph = dispatch(sources, manager, stdout)
+   File "/build.py", line 2942, in dispatch
+     process_graph(graph, manager)
+   File "/build.py", line 3340, in process_graph
+     process_stale_scc(graph, scc, manager)
+   File "/build.py", line 3435, in process_stale_scc
+     mypy.semanal_main.semantic_analysis_for_scc(graph, scc, manager.errors)
+   File "/semanal_main.py", line 93, in semantic_analysis_for_scc
+     process_top_levels(graph, scc, patches)
+   File "/semanal_main.py", line 220, in process_top_levels
+     deferred, incomplete, progress = semantic_analyze_target(
+   File "/semanal_main.py", line 349, in semantic_analyze_target
+     analyzer.refresh_partial(
+   File "/semanal.py", line 599, in refresh_partial
+     self.refresh_top_level(node)
+   File "/semanal.py", line 610, in refresh_top_level
+     self.accept(d)
+   File "/semanal.py", line 6588, in accept
+     node.accept(self)
+   File "/nodes.py", line 1310, in accept
+     return visitor.visit_assignment_stmt(self)
+   File "/semanal.py", line 2885, in visit_assignment_stmt
+     if self.check_and_set_up_type_alias(s):
+   File "/semanal.py", line 3663, in check_and_set_up_type_alias
+     res, alias_tvars, depends_on, qualified_tvars, empty_tuple_index = self.analyze_alias(
+   File "/semanal.py", line 3539, in analyze_alias
+     tvar_expr.default = tvar_expr.default.accept(
+   File "/types.py", line 1444, in accept
+     return visitor.visit_instance(self)
+   File "/type_visitor.py", line 212, in visit_instance
+     args=self.translate_types(t.args),
+   File "/type_visitor.py", line 272, in translate_types
+     return [t.accept(self) for t in types]
+   File "/type_visitor.py", line 272, in <listcomp>
+     return [t.accept(self) for t in types]
+   File "/types.py", line 410, in accept
+     return visitor.visit_type_alias_type(self)
+   File "/typeanal.py", line 2544, in visit_type_alias_type
+     raise NotImplementedError
+ NotImplementedError: 

steam.py (https://github.com/Gobot1234/steam.py)
+ steam/gateway.py:96: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
+ https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
+ Please report a bug at https://github.com/python/mypy/issues
+ version: 1.10.0+dev.bf580328084dc424f89eb531299931d2b34e9803
+ steam/gateway.py:96: : note: use --pdb to drop into pdb
- steam/_const.py:29: error: Module "steam.clan" has no attribute "Clan"  [attr-defined]
- steam/_const.py:30: error: Module "steam.group" has no attribute "Group"  [attr-defined]
- steam/_const.py:37: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:57: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:69: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:73: error: Function is missing a return type annotation  [no-untyped-def]
- steam/_const.py:73: error: Function is missing a type annotation for one or more arguments  [no-untyped-def]
- steam/_const.py:75: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:90: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:100: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:109: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:110: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:120: error: Unused "type: ignore" comment  [unused-ignore]
- steam/_const.py:194: error: Cannot assign to a method  [method-assign]
- steam/_const.py:194: error: Incompatible types in assignment (expression has type "Callable[[_IDComparable, object], bool]", variable has type "Callable[[object, object], bool]")  [assignment]
- steam/_const.py:195: error: Cannot assign to a method  [method-assign]
- steam/_const.py:195: error: Incompatible types in assignment (expression has type "Callable[[_IDComparable], int]", variable has type "Callable[[object], int]")  [assignment]
- steam/types/user.py:16: error: Module "steam.user" has no attribute "User"  [attr-defined]
- steam/types/user.py:139: error: Cannot resolve name "Author" (possible cyclic definition)  [misc]
- steam/types/user.py:143: error: Parameter 1 of Literal[...] is invalid  [valid-type]
- steam/invite.py:16: error: Module "steam.clan" has no attribute "Clan"  [attr-defined]
- steam/invite.py:19: error: Module "steam.group" has no attribute "Group"  [attr-defined]
- steam/invite.py:21: error: Module "steam.user" has no attribute "User"  [attr-defined]
- steam/invite.py:90: error: Attributes without a default cannot follow attributes with one  [misc]
- steam/invite.py:109: error: Attributes without a default cannot follow attributes with one  [misc]
- steam/invite.py:118: error: Cannot resolve name "ChatGroupInvite" (possible cyclic definition)  [misc]
- steam/invite.py:134: error: Call to abstract method "accept" of "_Invite" with trivial body via super() is unsafe  [safe-super]
- steam/enums.py:98: error: Function is missing a return type annotation  [no-untyped-def]
- steam/enums.py:98: note: Use "-> None" if function does not return a value
- steam/enums.py:108: error: Unused "type: ignore" comment  [unused-ignore]
- steam/enums.py:111: error: Unused "type: ignore" comment  [unused-ignore]
- steam/enums.py:124: error: Unused "type: ignore" comment  [unused-ignore]
- steam/enums.py:198: error: Unused "type: ignore" comment  [unused-ignore]
- steam/enums.py:247: error: Unused "type: ignore" comment  [unused-ignore]
- steam/enums.py:635: error: Unused "type: ignore" comment  [unused-ignore]
- steam/enums.py:638: error: Dict entry 0 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:639: error: Dict entry 1 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:640: error: Dict entry 2 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:641: error: Dict entry 3 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:642: error: Dict entry 4 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:643: error: Dict entry 5 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:644: error: Dict entry 6 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:645: error: Dict entry 7 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:646: error: Dict entry 8 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:647: error: Dict entry 9 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:648: error: Dict entry 10 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:649: error: Dict entry 11 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:650: error: Dict entry 12 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:651: error: Dict entry 13 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:652: error: Dict entry 14 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:653: error: Dict entry 15 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:654: error: Dict entry 16 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:655: error: Dict entry 17 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:656: error: Dict entry 18 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:657: error: Dict entry 19 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:658: error: Dict entry 20 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:659: error: Dict entry 21 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:660: error: Dict entry 22 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:661: error: Dict entry 23 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:662: error: Dict entry 24 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:663: error: Dict entry 25 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:664: error: Dict entry 26 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:665: error: Dict entry 27 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:666: error: Dict entry 28 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:670: error: Unused "type: ignore" comment  [unused-ignore]
- steam/enums.py:673: error: Dict entry 0 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:674: error: Dict entry 1 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:675: error: Dict entry 2 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:676: error: Dict entry 3 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:677: error: Dict entry 4 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:678: error: Dict entry 5 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:679: error: Dict entry 6 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:680: error: Dict entry 7 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:681: error: Dict entry 8 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:682: error: Dict entry 9 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:683: error: Dict entry 10 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:684: error: Dict entry 11 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:685: error: Dict entry 12 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:686: error: Dict entry 13 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:687: error: Dict entry 14 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:688: error: Dict entry 15 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:689: error: Dict entry 16 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:690: error: Dict entry 17 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:691: error: Dict entry 18 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:692: error: Dict entry 19 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:693: error: Dict entry 20 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:694: error: Dict entry 21 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:695: error: Dict entry 22 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]
- steam/enums.py:696: error: Dict entry 23 has incompatible type "int": "str"; expected "Language": "str"  [dict-item]

... (truncated 1229 lines) ...

Copy link

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

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