---
source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs
---
C415 Unnecessary subscript reversal of iterable within `set()`
 --> C415.py:2:5
  |
1 | lst = [2, 1, 3]
2 | a = set(lst[::-1])
  |     ^^^^^^^^^^^^^^
3 | b = reversed(lst[::-1])
4 | c = sorted(lst[::-1])
  |

C415 Unnecessary subscript reversal of iterable within `reversed()`
 --> C415.py:3:5
  |
1 | lst = [2, 1, 3]
2 | a = set(lst[::-1])
3 | b = reversed(lst[::-1])
  |     ^^^^^^^^^^^^^^^^^^^
4 | c = sorted(lst[::-1])
5 | d = sorted(lst[::-1], reverse=True)
  |

C415 Unnecessary subscript reversal of iterable within `sorted()`
 --> C415.py:4:5
  |
2 | a = set(lst[::-1])
3 | b = reversed(lst[::-1])
4 | c = sorted(lst[::-1])
  |     ^^^^^^^^^^^^^^^^^
5 | d = sorted(lst[::-1], reverse=True)
6 | e = set(lst[2:-1])
  |

C415 Unnecessary subscript reversal of iterable within `sorted()`
 --> C415.py:5:5
  |
3 | b = reversed(lst[::-1])
4 | c = sorted(lst[::-1])
5 | d = sorted(lst[::-1], reverse=True)
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6 | e = set(lst[2:-1])
7 | f = set(lst[:1:-1])
  |
