---
source: crates/ruff_linter/src/rules/flake8_bugbear/mod.rs
---
B033 [*] Sets should not contain duplicate item `"value1"`
 --> B033.py:4:18
  |
2 | # Errors.
3 | ###
4 | incorrect_set = {"value1", 23, 5, "value1"}
  |                  --------         ^^^^^^^^
  |                  |
  |                  Previous occurrence here
5 | incorrect_set = {1, 1, 2}
6 | incorrect_set_multiline = {
  |
help: Remove duplicate item
  |
3 | ###
  - incorrect_set = {"value1", 23, 5, "value1"}
4 + incorrect_set = {"value1", 23, 5}
5 | incorrect_set = {1, 1, 2}
  |

B033 [*] Sets should not contain duplicate item `1`
 --> B033.py:5:18
  |
3 | ###
4 | incorrect_set = {"value1", 23, 5, "value1"}
5 | incorrect_set = {1, 1, 2}
  |                  -  ^
  |                  |
  |                  Previous occurrence here
6 | incorrect_set_multiline = {
7 |     "value1",
  |
help: Remove duplicate item
  |
4 | incorrect_set = {"value1", 23, 5, "value1"}
  - incorrect_set = {1, 1, 2}
5 + incorrect_set = {1, 2}
6 | incorrect_set_multiline = {
  |

B033 [*] Sets should not contain duplicate item `"value1"`
  --> B033.py:7:5
   |
 5 | incorrect_set = {1, 1, 2}
 6 | incorrect_set_multiline = {
 7 |     "value1",
   |     -------- Previous occurrence here
 8 |     23,
 9 |     5,
10 |     "value1",
   |     ^^^^^^^^
11 |     # B033
12 | }
   |
help: Remove duplicate item
   |
9  |     5,
   -     "value1",
10 |     # B033
   |

B033 [*] Sets should not contain duplicate item `1`
  --> B033.py:13:18
   |
11 |     # B033
12 | }
13 | incorrect_set = {1, 1}
   |                  -  ^
   |                  |
   |                  Previous occurrence here
14 | incorrect_set = {1, 1,}
15 | incorrect_set = {0, 1, 1,}
   |
help: Remove duplicate item
   |
12 | }
   - incorrect_set = {1, 1}
13 + incorrect_set = {1}
14 | incorrect_set = {1, 1,}
   |

B033 [*] Sets should not contain duplicate item `1`
  --> B033.py:14:18
   |
12 | }
13 | incorrect_set = {1, 1}
14 | incorrect_set = {1, 1,}
   |                  -  ^
   |                  |
   |                  Previous occurrence here
15 | incorrect_set = {0, 1, 1,}
16 | incorrect_set = {0, 1, 1}
   |
help: Remove duplicate item
   |
13 | incorrect_set = {1, 1}
   - incorrect_set = {1, 1,}
14 + incorrect_set = {1,}
15 | incorrect_set = {0, 1, 1,}
   |

B033 [*] Sets should not contain duplicate item `1`
  --> B033.py:15:21
   |
13 | incorrect_set = {1, 1}
14 | incorrect_set = {1, 1,}
15 | incorrect_set = {0, 1, 1,}
   |                     -  ^
   |                     |
   |                     Previous occurrence here
16 | incorrect_set = {0, 1, 1}
17 | incorrect_set = {
   |
help: Remove duplicate item
   |
14 | incorrect_set = {1, 1,}
   - incorrect_set = {0, 1, 1,}
15 + incorrect_set = {0, 1,}
16 | incorrect_set = {0, 1, 1}
   |

B033 [*] Sets should not contain duplicate item `1`
  --> B033.py:16:21
   |
14 | incorrect_set = {1, 1,}
15 | incorrect_set = {0, 1, 1,}
16 | incorrect_set = {0, 1, 1}
   |                     -  ^
   |                     |
   |                     Previous occurrence here
17 | incorrect_set = {
18 |     0,
   |
help: Remove duplicate item
   |
15 | incorrect_set = {0, 1, 1,}
   - incorrect_set = {0, 1, 1}
16 + incorrect_set = {0, 1}
17 | incorrect_set = {
   |

B033 [*] Sets should not contain duplicate item `1`
  --> B033.py:19:5
   |
17 | incorrect_set = {
18 |     0,
19 |     1,
   |     - Previous occurrence here
20 |     1,
   |     ^
21 | }
22 | incorrect_set = {False, 1, 0}
   |
help: Remove duplicate item
   |
19 |     1,
   -     1,
20 | }
   |

B033 [*] Sets should not contain duplicate items, but `False` and `0` has the same value
  --> B033.py:22:18
   |
20 |     1,
21 | }
22 | incorrect_set = {False, 1, 0}
   |                  -----     ^
   |                  |
   |                  Previous occurrence here
23 | incorrect_set_multiline_with_comment = {
24 |     "value1",
   |
help: Remove duplicate item
   |
21 | }
   - incorrect_set = {False, 1, 0}
22 + incorrect_set = {False, 1}
23 | incorrect_set_multiline_with_comment = {
   |

B033 [*] Sets should not contain duplicate item `"value1"`
  --> B033.py:24:5
   |
22 | incorrect_set = {False, 1, 0}
23 | incorrect_set_multiline_with_comment = {
24 |     "value1",
   |     -------- Previous occurrence here
25 |     23,
26 |     # B033
27 |     "value1",
   |     ^^^^^^^^
28 | }
   |
help: Remove duplicate item
   |
25 |     23,
   -     # B033
   -     "value1",
26 | }
   |
note: This is an unsafe fix and may change runtime behavior
