-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Fix TypeVar defaults with None (PEP 696) #16859
Merged
JelleZijlstra
merged 1 commit into
python:master
from
cdce8p:TypeVar-10-fix-strict-optional
Feb 2, 2024
Merged
Fix TypeVar defaults with None (PEP 696) #16859
JelleZijlstra
merged 1 commit into
python:master
from
cdce8p:TypeVar-10-fix-strict-optional
Feb 2, 2024
Conversation
This file contains 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
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]]
|
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.
Ref: #14851