---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E713 [*] Test for membership should be `not in`
 --> E713.py:2:8
  |
1 | #: E713
2 | if not X in Y:
  |        ^^^^^^
3 |     pass
4 | #: E713
  |
help: Convert to `not in`
  |
1 | #: E713
  - if not X in Y:
2 + if X not in Y:
3 |     pass
  |

E713 [*] Test for membership should be `not in`
 --> E713.py:5:8
  |
3 |     pass
4 | #: E713
5 | if not X.B in Y:
  |        ^^^^^^^^
6 |     pass
7 | #: E713
  |
help: Convert to `not in`
  |
4 | #: E713
  - if not X.B in Y:
5 + if X.B not in Y:
6 |     pass
  |

E713 [*] Test for membership should be `not in`
  --> E713.py:8:8
   |
 6 |     pass
 7 | #: E713
 8 | if not X in Y and Z == "zero":
   |        ^^^^^^
 9 |     pass
10 | #: E713
   |
help: Convert to `not in`
  |
7 | #: E713
  - if not X in Y and Z == "zero":
8 + if X not in Y and Z == "zero":
9 |     pass
  |

E713 [*] Test for membership should be `not in`
  --> E713.py:11:23
   |
 9 |     pass
10 | #: E713
11 | if X == "zero" or not Y in Z:
   |                       ^^^^^^
12 |     pass
13 | #: E713
   |
help: Convert to `not in`
   |
10 | #: E713
   - if X == "zero" or not Y in Z:
11 + if X == "zero" or Y not in Z:
12 |     pass
   |

E713 [*] Test for membership should be `not in`
  --> E713.py:14:9
   |
12 |     pass
13 | #: E713
14 | if not (X in Y):
   |         ^^^^^^
15 |     pass
   |
help: Convert to `not in`
   |
13 | #: E713
   - if not (X in Y):
14 + if X not in Y:
15 |     pass
   |

E713 [*] Test for membership should be `not in`
  --> E713.py:40:12
   |
38 | assert [42, not foo] in bar
39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None)
40 | assert not('name' in request)or not request['name']
   |            ^^^^^^^^^^^^^^^^^
   |
help: Convert to `not in`
   |
39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None)
   - assert not('name' in request)or not request['name']
40 + assert 'name' not in request or not request['name']
   |
