---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB171 [*] Membership test against single-item container
 --> FURB171_1.py:3:4
  |
1 | # Errors.
2 |
3 | if 1 in set([1]):
  |    ^^^^^^^^^^^^^
4 |     print("Single-element set")
  |
help: Convert to equality test
  |
2 |
  - if 1 in set([1]):
3 + if 1 == 1:
4 |     print("Single-element set")
  |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
 --> FURB171_1.py:6:4
  |
4 |     print("Single-element set")
5 |
6 | if 1 in set((1,)):
  |    ^^^^^^^^^^^^^^
7 |     print("Single-element set")
  |
help: Convert to equality test
  |
5 |
  - if 1 in set((1,)):
6 + if 1 == 1:
7 |     print("Single-element set")
  |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
  --> FURB171_1.py:9:4
   |
 7 |     print("Single-element set")
 8 |
 9 | if 1 in set({1}):
   |    ^^^^^^^^^^^^^
10 |     print("Single-element set")
   |
help: Convert to equality test
   |
8  |
   - if 1 in set({1}):
9  + if 1 == 1:
10 |     print("Single-element set")
   |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
  --> FURB171_1.py:12:4
   |
10 |     print("Single-element set")
11 |
12 | if 1 in frozenset([1]):
   |    ^^^^^^^^^^^^^^^^^^^
13 |     print("Single-element set")
   |
help: Convert to equality test
   |
11 |
   - if 1 in frozenset([1]):
12 + if 1 == 1:
13 |     print("Single-element set")
   |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
  --> FURB171_1.py:15:4
   |
13 |     print("Single-element set")
14 |
15 | if 1 in frozenset((1,)):
   |    ^^^^^^^^^^^^^^^^^^^^
16 |     print("Single-element set")
   |
help: Convert to equality test
   |
14 |
   - if 1 in frozenset((1,)):
15 + if 1 == 1:
16 |     print("Single-element set")
   |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
  --> FURB171_1.py:18:4
   |
16 |     print("Single-element set")
17 |
18 | if 1 in frozenset({1}):
   |    ^^^^^^^^^^^^^^^^^^^
19 |     print("Single-element set")
   |
help: Convert to equality test
   |
17 |
   - if 1 in frozenset({1}):
18 + if 1 == 1:
19 |     print("Single-element set")
   |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
  --> FURB171_1.py:21:4
   |
19 |     print("Single-element set")
20 |
21 | if 1 in set(set([1])):
   |    ^^^^^^^^^^^^^^^^^^
22 |     print('Recursive solution')
   |
help: Convert to equality test
   |
20 |
   - if 1 in set(set([1])):
21 + if 1 == 1:
22 |     print('Recursive solution')
   |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
  --> FURB171_1.py:59:4
   |
58 | # set() and frozenset() with NaN
59 | if math.nan in set([math.nan]):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
60 |     print("This should be marked unsafe")
   |
help: Convert to equality test
   |
58 | # set() and frozenset() with NaN
   - if math.nan in set([math.nan]):
59 + if math.nan == math.nan:
60 |     print("This should be marked unsafe")
   |
note: This is an unsafe fix and may change runtime behavior

FURB171 [*] Membership test against single-item container
  --> FURB171_1.py:62:4
   |
60 |     print("This should be marked unsafe")
61 |
62 | if math.nan in frozenset([math.nan]):
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 |     print("This should be marked unsafe")
   |
help: Convert to equality test
   |
61 |
   - if math.nan in frozenset([math.nan]):
62 + if math.nan == math.nan:
63 |     print("This should be marked unsafe")
   |
note: This is an unsafe fix and may change runtime behavior
