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

Add UP rule: rewrite TypeVar defaults for Generator / AsyncGenerator #13269

Closed
hugovk opened this issue Sep 6, 2024 · 2 comments
Closed

Add UP rule: rewrite TypeVar defaults for Generator / AsyncGenerator #13269

hugovk opened this issue Sep 6, 2024 · 2 comments
Assignees
Labels
accepted Ready for implementation help wanted Contributions especially welcome rule Implementing or modifying a lint rule

Comments

@hugovk
Copy link
Contributor

hugovk commented Sep 6, 2024

There's a new check in pyupgrade to rewrite using PEP 696 TypeVar defaults:

from collections.abc import Generator, AsyncGenerator

-def f() -> Generator[int, None, None]:
+def f() -> Generator[int]:
     yield 1
from collections.abc import Generator, AsyncGenerator

-async def f() -> AsyncGenerator[int, None]:
+async def f() -> AsyncGenerator[int]:
     yield 1

See the https://github.com/asottile/pyupgrade/pull/948/files for some variations.

@AlexWaygood AlexWaygood added rule Implementing or modifying a lint rule help wanted Contributions especially welcome accepted Ready for implementation labels Sep 7, 2024
@iamlucasvieira
Copy link
Contributor

May I work on this one?

@iamlucasvieira
Copy link
Contributor

I think we already have this rule implemented: UP043

@MichaReiser MichaReiser closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation help wanted Contributions especially welcome rule Implementing or modifying a lint rule
Projects
None yet
Development

No branches or pull requests

4 participants