---
source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs
---
C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
 --> C409.py:1:6
  |
1 | t1 = tuple([])
  |      ^^^^^^^^^
2 | t2 = tuple([1, 2])
3 | t3 = tuple((1, 2))
  |
help: Rewrite as a tuple literal
  |
  - t1 = tuple([])
1 + t1 = ()
2 | t2 = tuple([1, 2])
  |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
 --> C409.py:2:6
  |
1 | t1 = tuple([])
2 | t2 = tuple([1, 2])
  |      ^^^^^^^^^^^^^
3 | t3 = tuple((1, 2))
4 | t4 = tuple([
  |
help: Rewrite as a tuple literal
  |
1 | t1 = tuple([])
  - t2 = tuple([1, 2])
2 + t2 = (1, 2)
3 | t3 = tuple((1, 2))
  |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary tuple literal passed to `tuple()` (remove the outer call to `tuple()`)
 --> C409.py:3:6
  |
1 | t1 = tuple([])
2 | t2 = tuple([1, 2])
3 | t3 = tuple((1, 2))
  |      ^^^^^^^^^^^^^
4 | t4 = tuple([
5 |     1,
  |
help: Remove the outer call to `tuple()`
  |
2 | t2 = tuple([1, 2])
  - t3 = tuple((1, 2))
3 + t3 = (1, 2)
4 | t4 = tuple([
  |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
 --> C409.py:4:6
  |
2 |   t2 = tuple([1, 2])
3 |   t3 = tuple((1, 2))
4 |   t4 = tuple([
  |  ______^
5 | |     1,
6 | |     2
7 | | ])
  | |__^
8 |   t5 = tuple(
9 |       (1, 2)
  |
help: Rewrite as a tuple literal
  |
3 | t3 = tuple((1, 2))
  - t4 = tuple([
4 + t4 = (
5 |     1,
6 |     2
  - ])
7 + )
8 | t5 = tuple(
  |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary tuple literal passed to `tuple()` (remove the outer call to `tuple()`)
  --> C409.py:8:6
   |
 6 |       2
 7 |   ])
 8 |   t5 = tuple(
   |  ______^
 9 | |     (1, 2)
10 | | )
   | |_^
11 |
12 |   tuple(  # comment
   |
help: Remove the outer call to `tuple()`
  |
7 | ])
  - t5 = tuple(
  -     (1, 2)
  - )
8 + t5 = (1, 2)
9 |
  |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
  --> C409.py:12:1
   |
10 |   )
11 |
12 | / tuple(  # comment
13 | |     [1, 2]
14 | | )
   | |_^
15 |
16 |   tuple([  # comment
   |
help: Rewrite as a tuple literal
   |
11 |
   - tuple(  # comment
   -     [1, 2]
   - )
12 + (1, 2)
13 |
   |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
  --> C409.py:16:1
   |
14 |   )
15 |
16 | / tuple([  # comment
17 | |     1, 2
18 | | ])
   | |__^
19 |
20 |   tuple((
   |
help: Rewrite as a tuple literal
   |
15 |
   - tuple([  # comment
16 + (  # comment
17 |     1, 2
   - ])
18 + )
19 |
   |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary tuple literal passed to `tuple()` (remove the outer call to `tuple()`)
  --> C409.py:20:1
   |
18 |   ])
19 |
20 | / tuple((
21 | |     1,
22 | | ))
   | |__^
23 |
24 |   t6 = tuple([1])
   |
help: Remove the outer call to `tuple()`
   |
19 |
   - tuple((
20 + (
21 |     1,
   - ))
22 + )
23 |
   |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
  --> C409.py:24:6
   |
22 | ))
23 |
24 | t6 = tuple([1])
   |      ^^^^^^^^^^
25 | t7 = tuple((1,))
26 | t8 = tuple([1,])
   |
help: Rewrite as a tuple literal
   |
23 |
   - t6 = tuple([1])
24 + t6 = (1,)
25 | t7 = tuple((1,))
   |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary tuple literal passed to `tuple()` (remove the outer call to `tuple()`)
  --> C409.py:25:6
   |
24 | t6 = tuple([1])
25 | t7 = tuple((1,))
   |      ^^^^^^^^^^^
26 | t8 = tuple([1,])
   |
help: Remove the outer call to `tuple()`
   |
24 | t6 = tuple([1])
   - t7 = tuple((1,))
25 + t7 = (1,)
26 | t8 = tuple([1,])
   |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
  --> C409.py:26:6
   |
24 | t6 = tuple([1])
25 | t7 = tuple((1,))
26 | t8 = tuple([1,])
   |      ^^^^^^^^^^^
27 |
28 | tuple([x for x in range(5)])
   |
help: Rewrite as a tuple literal
   |
25 | t7 = tuple((1,))
   - t8 = tuple([1,])
26 + t8 = (1,)
27 |
   |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
  --> C409.py:46:6
   |
44 | )
45 |
46 | t9 = tuple([1],)
   |      ^^^^^^^^^^^
47 | t10 = tuple([1, 2],)
   |
help: Rewrite as a tuple literal
   |
45 |
   - t9 = tuple([1],)
46 + t9 = (1,)
47 | t10 = tuple([1, 2],)
   |
note: This is an unsafe fix and may change runtime behavior

C409 [*] Unnecessary list literal passed to `tuple()` (rewrite as a tuple literal)
  --> C409.py:47:7
   |
46 | t9 = tuple([1],)
47 | t10 = tuple([1, 2],)
   |       ^^^^^^^^^^^^^^
   |
help: Rewrite as a tuple literal
   |
46 | t9 = tuple([1],)
   - t10 = tuple([1, 2],)
47 + t10 = (1, 2)
   |
note: This is an unsafe fix and may change runtime behavior
