list-reverse-copy (FURB187)#
Derived from the refurb linter.
Fix is always available.
This rule is unstable and in preview. The --preview
flag is required for use.
What it does#
Checks for list reversals that can be performed in-place in lieu of creating a new list.
Why is this bad?#
When reversing a list, it's more efficient to use the in-place method
.reverse()
instead of creating a new list, if the original list is
no longer needed.
Example#
Use instead: