-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingquestionAsking for support or clarificationAsking for support or clarification
Description
The autofix for C413 can lead to bugs if the key parameter is used. Here is a little code example to show, that the results before and after the autofix are different.
original = [(1, 0), (2, 0), (3, 1), (4, 1)]
print(list(reversed(sorted(original, key=lambda x: x[1]))))
print(sorted(original, key=lambda x: x[1], reverse=True))Here is the output:
[(4, 1), (3, 1), (2, 0), (1, 0)]
[(3, 1), (4, 1), (1, 0), (2, 0)]
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingquestionAsking for support or clarificationAsking for support or clarification