-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Summary
The documentation for unnecessary-call-around-sorted (C413) says:
This rule's fix is marked as unsafe, as
reversed()andreverse=Truewill yield different results in the event of custom sort keys or equality functions. Specifically,reversed()will reverse the order of the collection, whilesorted()withreverse=Truewill perform a stable reverse sort, which will preserve the order of elements that compare as equal.
That makes it sound like the fix is always marked as unsafe. In fact, it is marked as unsafe for reversed and safe for list.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation