-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule
Description
Saw this in code:
a = sorted(l)[0]
a = sorted(l, reverse=True)[-1] # not sure about this one....should be
a = min(l)Additionally, the following code pattern can also be simplified
a = sorted(l, reverse=True)[0]
a = sorted(l)[-1] # not sure about this, sort stability could make it output a different value, right?should be
a = max(l)Is there already a pylint rule for this? I wouldn't be surprised. If not, let's add it as a RUFF rule.
I am not sure about the [-1] variants, as there may be some subtlety there with sort stability?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ruleImplementing or modifying a lint ruleImplementing or modifying a lint rule