-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 check for unnecessary-default-type-args
#9938
Add check for unnecessary-default-type-args
#9938
Conversation
9641ce2
to
f25fda9
Compare
f25fda9
to
ef87e5e
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9938 +/- ##
=======================================
Coverage 95.80% 95.80%
=======================================
Files 174 174
Lines 18933 18940 +7
=======================================
+ Hits 18139 18146 +7
Misses 794 794
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great ! I'm glad we did not release 3.3.0 asap after the merge of #9853, this is a nice check to have in the first python 3.13 release !
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Jacob Walls <[email protected]>
🤖 Effect of this PR on checked open source code: 🤖 Effect on astroid:
Effect on music21:
Effect on pandas:
Effect on sentry:
This comment was generated for commit d0b84f5 |
Type of Changes
Description
Starting with Python 3.13,
typing.Generator
andtyping.AsyncGenerator
have default type argument. E.g. it's no longer necessary to specifyNone, None
for the send and return type.This check is similar to the one in ruff but extends on it to also cover the collections.abc` variants which can also be used with older Python versions.
https://docs.astral.sh/ruff/rules/unnecessary-default-type-args/
https://github.com/asottile/pyupgrade?tab=readme-ov-file#pep-696-typevar-defaults