-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[
pyupgrade
] Fix UP043 to apply to collections.abc.Generator
and `…
…collections.abc.AsyncGenerator` (#13611) ## Summary fix #13602 Currently, `UP043` only applies to typing.Generator, but it should also support collections.abc.Generator. This update ensures `UP043` correctly handles both `collections.abc.Generator` and `collections.abc.AsyncGenerator` ### UP043 > `UP043` > Python 3.13 introduced the ability for type parameters to specify default values. As such, the default type arguments for some types in the standard library (e.g., Generator, AsyncGenerator) are now optional. > Omitting type parameters that match the default values can make the code more concise and easier to read. ```py Generator[int, None, None] -> Generator[int] ```
- Loading branch information
1 parent
7e3894f
commit 3728d5b
Showing
3 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
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
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
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