-
-
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
Check py-version
for async unnecessary-dunder-call
#7549
Conversation
Pull Request Test Coverage Report for Build 3165251258
💛 - Coveralls |
pylint/checkers/dunder_methods.py
Outdated
@@ -105,8 +105,6 @@ | |||
"__floor__": "Use math.floor function", | |||
"__ceil__": "Use math.ceil function", | |||
"__enter__": "Invoke context manager directly", |
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.
I think we should handle this generically by changing this datastructure (DUNDER_METHODS) to include the min version of the dunder method. Maybe:
DUNDER_METHODS = {
"3.10": {
"__aiter__": "Use iter built-in function",
"__anext__": "Use next built-in function",
}
"default" : {
"__index__": "Use index method",
"__round__": "Use round built-in function",
...
}
}
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.
Thank you for the fix !
"__deepcopy__": "Use copy.deepcopy function", | ||
"__fspath__": "Use os.fspath function instead", | ||
DUNDER_METHODS: dict[tuple[int, int], dict[str, str]] = { | ||
(0, 0): { |
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.
Clever 👍
towncrier create <IssueNumber>.<type>
which will beincluded in the changelog.
<type>
can be one of: new_check, removed_check, extension,false_positive, false_negative, bugfix, other, internal. If necessary you can write
details or offer examples on how the new change is supposed to work.
and preferred name in
script/.contributors_aliases.json
Type of Changes
Description
Closes #7529.