---
source: crates/ruff_linter/src/rules/pycodestyle/mod.rs
---
E714.py:2:8: E714 [*] Test for object identity should be `is not`
  |
1 | #: E714
2 | if not X is Y:
  |        ^^^^^^ E714
3 |     pass
4 | #: E714
  |
  = help: Convert to `is not`

ℹ Safe fix
1 1 | #: E714
2   |-if not X is Y:
  2 |+if X is not Y:
3 3 |     pass
4 4 | #: E714
5 5 | if not X.B is Y:

E714.py:5:8: E714 [*] Test for object identity should be `is not`
  |
3 |     pass
4 | #: E714
5 | if not X.B is Y:
  |        ^^^^^^^^ E714
6 |     pass
  |
  = help: Convert to `is not`

ℹ Safe fix
2 2 | if not X is Y:
3 3 |     pass
4 4 | #: E714
5   |-if not X.B is Y:
  5 |+if X.B is not Y:
6 6 |     pass
7 7 | 
8 8 | #: Okay

E714.py:39:13: E714 [*] Test for object identity should be `is not`
   |
37 | assert {"x": not foo} in bar
38 | assert [42, not foo] in bar
39 | assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None)
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E714
   |
   = help: Convert to `is not`

ℹ Safe fix
36 36 | assert (not foo) in bar
37 37 | assert {"x": not foo} in bar
38 38 | assert [42, not foo] in bar
39    |-assert not (re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is None)
   39 |+assert re.search(r"^.:\\Users\\[^\\]*\\Downloads\\.*") is not None


