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

[pyupgrade] Implement unnecessary-default-type-args (UP043) #12371

Conversation

cake-monotone
Copy link
Contributor

Summary

Add new rule and implement for unnecessary default type arguments under the UP category (UP043).

// < py313
Generator[int, None, None] 

// >= py313
Generator[int]

I think that as Python 3.13 develops, there might be more default type arguments added besides Generator and AsyncGenerator. So, I made this more flexible to accommodate future changes.

related issue: #12286

Test Plan

snapshot included..!

@cake-monotone cake-monotone changed the title [pyupgrade] Implement unnecessary default type args (UP043) [pyupgrade] Implement unnecessary-default-type-args (UP043) Jul 17, 2024
@charliermarsh
Copy link
Member

Nice, thank you! Will review.

@charliermarsh charliermarsh added rule Implementing or modifying a lint rule preview Related to preview mode features labels Jul 17, 2024
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you. I just made some minor tweaks to formatting and docs.

@charliermarsh charliermarsh enabled auto-merge (squash) July 17, 2024 19:39
@charliermarsh charliermarsh merged commit 1df51b1 into astral-sh:main Jul 17, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants