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

Suggest >2 arguments for min/max functions #7546

Closed
bje- opened this issue Oct 1, 2022 · 3 comments · Fixed by #7550
Closed

Suggest >2 arguments for min/max functions #7546

bje- opened this issue Oct 1, 2022 · 3 comments · Fixed by #7550
Labels
Enhancement ✨ Improvement to a component Hacktoberfest Needs PR This issue is accepted, sufficiently specified and now needs an implementation Optional Checkers Related to a checked, disabled by default
Milestone

Comments

@bje-
Copy link

bje- commented Oct 1, 2022

Current problem

Some Python users may be unaware that the min and max functions allow for more than two arguments.

Desired solution

Expressions of the form: min(a, min(b, min(c, d)) can be replaced with the simpler x = min(a, b, c, d).

Additional context

No response

@bje- bje- added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Oct 1, 2022
@Pierre-Sassoulas Pierre-Sassoulas added Enhancement ✨ Improvement to a component Optional Checkers Related to a checked, disabled by default Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Oct 1, 2022
@osherdp
Copy link
Contributor

osherdp commented Oct 1, 2022

Should be simple enough. I'll take a look

@DanielNoord
Copy link
Collaborator

@Pierre-Sassoulas You gave this an Optional Checker, but shouldn't this be part of RefactoringChecker?

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.16.0 milestone Oct 1, 2022
@Pierre-Sassoulas
Copy link
Member

I thought about an extension at first but yeah why not.

I think this is a discussion we already had at some point, ideally I would want to have checker handling less messages and be more decoupled. If this is in an independent file it means less work if we change our mind (i.e. we don't have to copy paste code from the RefactoringChecker we can switch a boolean somewhere).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ Improvement to a component Hacktoberfest Needs PR This issue is accepted, sufficiently specified and now needs an implementation Optional Checkers Related to a checked, disabled by default
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants