---
source: crates/ruff_linter/src/rules/flake8_comprehensions/mod.rs
---
C408 [*] Unnecessary `tuple()` call (rewrite as a literal)
 --> C408.py:1:5
  |
1 | t = tuple()
  |     ^^^^^^^
2 | l = list()
3 | d1 = dict()
  |
help: Rewrite as a literal
  |
  - t = tuple()
1 + t = ()
2 | l = list()
  |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `list()` call (rewrite as a literal)
 --> C408.py:2:5
  |
1 | t = tuple()
2 | l = list()
  |     ^^^^^^
3 | d1 = dict()
4 | d2 = dict(a=1)
  |
help: Rewrite as a literal
  |
1 | t = tuple()
  - l = list()
2 + l = []
3 | d1 = dict()
  |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `dict()` call (rewrite as a literal)
 --> C408.py:3:6
  |
1 | t = tuple()
2 | l = list()
3 | d1 = dict()
  |      ^^^^^^
4 | d2 = dict(a=1)
5 | d3 = dict(**d2)
  |
help: Rewrite as a literal
  |
2 | l = list()
  - d1 = dict()
3 + d1 = {}
4 | d2 = dict(a=1)
  |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `dict()` call (rewrite as a literal)
  --> C408.py:16:4
   |
14 | f"{dict(x='y')}"
15 | f'{dict(x="y")}'
16 | f"{dict()}"
   |    ^^^^^^
17 | f"a {dict()} b"
   |
help: Rewrite as a literal
   |
15 | f'{dict(x="y")}'
   - f"{dict()}"
16 + f"{ {} }"
17 | f"a {dict()} b"
   |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `dict()` call (rewrite as a literal)
  --> C408.py:17:6
   |
15 | f'{dict(x="y")}'
16 | f"{dict()}"
17 | f"a {dict()} b"
   |      ^^^^^^
18 |
19 | f"{dict(x='y') | dict(y='z')}"
   |
help: Rewrite as a literal
   |
16 | f"{dict()}"
   - f"a {dict()} b"
17 + f"a { {} } b"
18 |
   |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `dict()` call (rewrite as a literal)
  --> C408.py:24:1
   |
22 |   f"a { dict(x='y') | dict(y='z') } b"
23 |
24 | / dict(
25 | |     # comment
26 | | )
   | |_^
27 |
28 |   tuple(  # comment
   |
help: Rewrite as a literal
   |
23 |
   - dict(
24 + {
25 |     # comment
   - )
26 + }
27 |
   |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `tuple()` call (rewrite as a literal)
  --> C408.py:28:1
   |
26 |   )
27 |
28 | / tuple(  # comment
29 | | )
   | |_^
30 |
31 |   t"{dict(x='y')}"
   |
help: Rewrite as a literal
   |
27 |
   - tuple(  # comment
28 + (  # comment
29 | )
   |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `dict()` call (rewrite as a literal)
  --> C408.py:33:4
   |
31 | t"{dict(x='y')}"
32 | t'{dict(x="y")}'
33 | t"{dict()}"
   |    ^^^^^^
34 | t"a {dict()} b"
   |
help: Rewrite as a literal
   |
32 | t'{dict(x="y")}'
   - t"{dict()}"
33 + t"{ {} }"
34 | t"a {dict()} b"
   |
note: This is an unsafe fix and may change runtime behavior

C408 [*] Unnecessary `dict()` call (rewrite as a literal)
  --> C408.py:34:6
   |
32 | t'{dict(x="y")}'
33 | t"{dict()}"
34 | t"a {dict()} b"
   |      ^^^^^^
35 |
36 | t"{dict(x='y') | dict(y='z')}"
   |
help: Rewrite as a literal
   |
33 | t"{dict()}"
   - t"a {dict()} b"
34 + t"a { {} } b"
35 |
   |
note: This is an unsafe fix and may change runtime behavior
