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

ℹ Suggested fix
1   |-x = list(x for x in range(3))
  1 |+x = [x for x in range(3)]
2 2 | x = list(
3 3 |     x for x in range(3)
4 4 | )

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

ℹ Suggested fix
1 1 | x = list(x for x in range(3))
2   |-x = list(
  2 |+x = [
3 3 |     x for x in range(3)
4   |-)
  4 |+]
5 5 | 
6 6 | 
7 7 | def list(*args, **kwargs):


