---
source: crates/ruff/src/rules/flake8_comprehensions/mod.rs
---
C403.py:1:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension)
  |
1 | s = set([x for x in range(3)])
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^ C403
2 | s = set(
3 |     [x for x in range(3)]
  |
  = help: Rewrite as a `set` comprehension

ℹ Suggested fix
1   |-s = set([x for x in range(3)])
  1 |+s = {x for x in range(3)}
2 2 | s = set(
3 3 |     [x for x in range(3)]
4 4 | )

C403.py:2:5: C403 [*] Unnecessary `list` comprehension (rewrite as a `set` comprehension)
  |
2 |   s = set([x for x in range(3)])
3 |   s = set(
  |  _____^
4 | |     [x for x in range(3)]
5 | | )
  | |_^ C403
  |
  = help: Rewrite as a `set` comprehension

ℹ Suggested fix
1 1 | s = set([x for x in range(3)])
2   |-s = set(
3   |-    [x for x in range(3)]
4   |-)
  2 |+s = {
  3 |+    x for x in range(3)
  4 |+}


