---
source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs
---
C419_1.py:1:5: C419 [*] Unnecessary list comprehension
  |
1 | sum([x.val for x in bar])
  |     ^^^^^^^^^^^^^^^^^^^^ C419
2 | min([x.val for x in bar])
3 | max([x.val for x in bar])
  |
  = help: Remove unnecessary list comprehension

ℹ Unsafe fix
1   |-sum([x.val for x in bar])
  1 |+sum(x.val for x in bar)
2 2 | min([x.val for x in bar])
3 3 | max([x.val for x in bar])
4 4 | 

C419_1.py:2:5: C419 [*] Unnecessary list comprehension
  |
1 | sum([x.val for x in bar])
2 | min([x.val for x in bar])
  |     ^^^^^^^^^^^^^^^^^^^^ C419
3 | max([x.val for x in bar])
  |
  = help: Remove unnecessary list comprehension

ℹ Unsafe fix
1 1 | sum([x.val for x in bar])
2   |-min([x.val for x in bar])
  2 |+min(x.val for x in bar)
3 3 | max([x.val for x in bar])
4 4 | 
5 5 | # Ok

C419_1.py:3:5: C419 [*] Unnecessary list comprehension
  |
1 | sum([x.val for x in bar])
2 | min([x.val for x in bar])
3 | max([x.val for x in bar])
  |     ^^^^^^^^^^^^^^^^^^^^ C419
4 | 
5 | # Ok
  |
  = help: Remove unnecessary list comprehension

ℹ Unsafe fix
1 1 | sum([x.val for x in bar])
2 2 | min([x.val for x in bar])
3   |-max([x.val for x in bar])
  3 |+max(x.val for x in bar)
4 4 | 
5 5 | # Ok
6 6 | sum(x.val for x in bar)
