---
source: crates/ruff/src/rules/pycodestyle/mod.rs
---
E711.py:2:11: E711 [*] Comparison to `None` should be `cond is None`
  |
2 | #: E711
3 | if res == None:
  |           ^^^^ E711
4 |     pass
5 | #: E711
  |
  = help: Replace with `cond is None`

ℹ Suggested fix
1 1 | #: E711
2   |-if res == None:
  2 |+if res is None:
3 3 |     pass
4 4 | #: E711
5 5 | if res != None:

E711.py:5:11: E711 [*] Comparison to `None` should be `cond is not None`
  |
5 |     pass
6 | #: E711
7 | if res != None:
  |           ^^^^ E711
8 |     pass
9 | #: E711
  |
  = help: Replace with `cond is not None`

ℹ Suggested fix
2 2 | if res == None:
3 3 |     pass
4 4 | #: E711
5   |-if res != None:
  5 |+if res is not None:
6 6 |     pass
7 7 | #: E711
8 8 | if None == res:

E711.py:8:4: E711 [*] Comparison to `None` should be `cond is None`
   |
 8 |     pass
 9 | #: E711
10 | if None == res:
   |    ^^^^ E711
11 |     pass
12 | #: E711
   |
   = help: Replace with `cond is None`

ℹ Suggested fix
5 5 | if res != None:
6 6 |     pass
7 7 | #: E711
8   |-if None == res:
  8 |+if None is res:
9 9 |     pass
10 10 | #: E711
11 11 | if None != res:

E711.py:11:4: E711 [*] Comparison to `None` should be `cond is not None`
   |
11 |     pass
12 | #: E711
13 | if None != res:
   |    ^^^^ E711
14 |     pass
15 | #: E711
   |
   = help: Replace with `cond is not None`

ℹ Suggested fix
8  8  | if None == res:
9  9  |     pass
10 10 | #: E711
11    |-if None != res:
   11 |+if None is not res:
12 12 |     pass
13 13 | #: E711
14 14 | if res[1] == None:

E711.py:14:14: E711 [*] Comparison to `None` should be `cond is None`
   |
14 |     pass
15 | #: E711
16 | if res[1] == None:
   |              ^^^^ E711
17 |     pass
18 | #: E711
   |
   = help: Replace with `cond is None`

ℹ Suggested fix
11 11 | if None != res:
12 12 |     pass
13 13 | #: E711
14    |-if res[1] == None:
   14 |+if res[1] is None:
15 15 |     pass
16 16 | #: E711
17 17 | if res[1] != None:

E711.py:17:14: E711 [*] Comparison to `None` should be `cond is not None`
   |
17 |     pass
18 | #: E711
19 | if res[1] != None:
   |              ^^^^ E711
20 |     pass
21 | #: E711
   |
   = help: Replace with `cond is not None`

ℹ Suggested fix
14 14 | if res[1] == None:
15 15 |     pass
16 16 | #: E711
17    |-if res[1] != None:
   17 |+if res[1] is not None:
18 18 |     pass
19 19 | #: E711
20 20 | if None != res[1]:

E711.py:20:4: E711 [*] Comparison to `None` should be `cond is not None`
   |
20 |     pass
21 | #: E711
22 | if None != res[1]:
   |    ^^^^ E711
23 |     pass
24 | #: E711
   |
   = help: Replace with `cond is not None`

ℹ Suggested fix
17 17 | if res[1] != None:
18 18 |     pass
19 19 | #: E711
20    |-if None != res[1]:
   20 |+if None is not res[1]:
21 21 |     pass
22 22 | #: E711
23 23 | if None == res[1]:

E711.py:23:4: E711 [*] Comparison to `None` should be `cond is None`
   |
23 |     pass
24 | #: E711
25 | if None == res[1]:
   |    ^^^^ E711
26 |     pass
   |
   = help: Replace with `cond is None`

ℹ Suggested fix
20 20 | if None != res[1]:
21 21 |     pass
22 22 | #: E711
23    |-if None == res[1]:
   23 |+if None is res[1]:
24 24 |     pass
25 25 | 
26 26 | if x == None != None:

E711.py:26:9: E711 [*] Comparison to `None` should be `cond is None`
   |
26 |     pass
27 | 
28 | if x == None != None:
   |         ^^^^ E711
29 |     pass
   |
   = help: Replace with `cond is None`

ℹ Suggested fix
23 23 | if None == res[1]:
24 24 |     pass
25 25 | 
26    |-if x == None != None:
   26 |+if x is None is not None:
27 27 |     pass
28 28 | 
29 29 | #: Okay

E711.py:26:17: E711 [*] Comparison to `None` should be `cond is not None`
   |
26 |     pass
27 | 
28 | if x == None != None:
   |                 ^^^^ E711
29 |     pass
   |
   = help: Replace with `cond is not None`

ℹ Suggested fix
23 23 | if None == res[1]:
24 24 |     pass
25 25 | 
26    |-if x == None != None:
   26 |+if x is None is not None:
27 27 |     pass
28 28 | 
29 29 | #: Okay


