-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
[Enhancement]: min
/max
instead of sorted(l)[0]
#332
Comments
min
/max
instead of sorted(l)[0]
The docs specifically say it's the same behavior:
|
@Skylion007 Thank you for opening this! I'll go ahead and implement this right now since it seems easy enough. |
Done! Thanks again for opening this. This sparked an idea for another check I could add tomorrow. |
Overview
sorted(a)[0]
should be replaced withmin(a)
. See astral-sh/ruff#10463 for more details if we should put it under a refurb error codeProposal
Convert
sorted(a)[0]
tomin(a)
. Also convertsorted(a, reverse=True)
tomax(a)
assuming they are equivalent with sort stability (need to double check).The text was updated successfully, but these errors were encountered: