---
source: crates/ruff/src/rules/pycodestyle/mod.rs
---
constant_literals.py:4:4: F632 [*] Use `==` to compare constant literals
  |
4 | # Errors
5 | ###
6 | if "abc" is "def":  # F632 (fix)
  |    ^^^^^^^^^^^^^^ F632
7 |     pass
8 | if "abc" is None:  # F632 (fix, but leaves behind unfixable E711)
  |
  = help: Replace `is` with `==`

ℹ Suggested fix
1 1 | ###
2 2 | # Errors
3 3 | ###
4   |-if "abc" is "def":  # F632 (fix)
  4 |+if "abc" == "def":  # F632 (fix)
5 5 |     pass
6 6 | if "abc" is None:  # F632 (fix, but leaves behind unfixable E711)
7 7 |     pass

constant_literals.py:6:4: F632 [*] Use `==` to compare constant literals
   |
 6 | if "abc" is "def":  # F632 (fix)
 7 |     pass
 8 | if "abc" is None:  # F632 (fix, but leaves behind unfixable E711)
   |    ^^^^^^^^^^^^^ F632
 9 |     pass
10 | if None is "abc":  # F632 (fix, but leaves behind unfixable E711)
   |
   = help: Replace `is` with `==`

ℹ Suggested fix
3 3 | ###
4 4 | if "abc" is "def":  # F632 (fix)
5 5 |     pass
6   |-if "abc" is None:  # F632 (fix, but leaves behind unfixable E711)
  6 |+if "abc" == None:  # F632 (fix, but leaves behind unfixable E711)
7 7 |     pass
8 8 | if None is "abc":  # F632 (fix, but leaves behind unfixable E711)
9 9 |     pass

constant_literals.py:8:4: F632 [*] Use `==` to compare constant literals
   |
 8 | if "abc" is None:  # F632 (fix, but leaves behind unfixable E711)
 9 |     pass
10 | if None is "abc":  # F632 (fix, but leaves behind unfixable E711)
   |    ^^^^^^^^^^^^^ F632
11 |     pass
12 | if "abc" is False:  # F632 (fix, but leaves behind unfixable E712)
   |
   = help: Replace `is` with `==`

ℹ Suggested fix
5 5 |     pass
6 6 | if "abc" is None:  # F632 (fix, but leaves behind unfixable E711)
7 7 |     pass
8   |-if None is "abc":  # F632 (fix, but leaves behind unfixable E711)
  8 |+if None == "abc":  # F632 (fix, but leaves behind unfixable E711)
9 9 |     pass
10 10 | if "abc" is False:  # F632 (fix, but leaves behind unfixable E712)
11 11 |     pass

constant_literals.py:10:4: F632 [*] Use `==` to compare constant literals
   |
10 | if None is "abc":  # F632 (fix, but leaves behind unfixable E711)
11 |     pass
12 | if "abc" is False:  # F632 (fix, but leaves behind unfixable E712)
   |    ^^^^^^^^^^^^^^ F632
13 |     pass
14 | if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
   |
   = help: Replace `is` with `==`

ℹ Suggested fix
7  7  |     pass
8  8  | if None is "abc":  # F632 (fix, but leaves behind unfixable E711)
9  9  |     pass
10    |-if "abc" is False:  # F632 (fix, but leaves behind unfixable E712)
   10 |+if "abc" == False:  # F632 (fix, but leaves behind unfixable E712)
11 11 |     pass
12 12 | if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
13 13 |     pass

constant_literals.py:12:4: F632 [*] Use `==` to compare constant literals
   |
12 | if "abc" is False:  # F632 (fix, but leaves behind unfixable E712)
13 |     pass
14 | if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
   |    ^^^^^^^^^^^^^^ F632
15 |     pass
16 | if False == None:  # E711, E712 (fix)
   |
   = help: Replace `is` with `==`

ℹ Suggested fix
9  9  |     pass
10 10 | if "abc" is False:  # F632 (fix, but leaves behind unfixable E712)
11 11 |     pass
12    |-if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
   12 |+if False == "abc":  # F632 (fix, but leaves behind unfixable E712)
13 13 |     pass
14 14 | if False == None:  # E711, E712 (fix)
15 15 |     pass

constant_literals.py:14:4: E712 [*] Comparison to `False` should be `cond is False` or `if not cond:`
   |
14 | if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
15 |     pass
16 | if False == None:  # E711, E712 (fix)
   |    ^^^^^ E712
17 |     pass
18 | if None == False:  # E711, E712 (fix)
   |
   = help: Replace with `cond is False`

ℹ Suggested fix
11 11 |     pass
12 12 | if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
13 13 |     pass
14    |-if False == None:  # E711, E712 (fix)
   14 |+if False is None:  # E711, E712 (fix)
15 15 |     pass
16 16 | if None == False:  # E711, E712 (fix)
17 17 |     pass

constant_literals.py:14:13: E711 [*] Comparison to `None` should be `cond is None`
   |
14 | if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
15 |     pass
16 | if False == None:  # E711, E712 (fix)
   |             ^^^^ E711
17 |     pass
18 | if None == False:  # E711, E712 (fix)
   |
   = help: Replace with `cond is None`

ℹ Suggested fix
11 11 |     pass
12 12 | if False is "abc":  # F632 (fix, but leaves behind unfixable E712)
13 13 |     pass
14    |-if False == None:  # E711, E712 (fix)
   14 |+if False is None:  # E711, E712 (fix)
15 15 |     pass
16 16 | if None == False:  # E711, E712 (fix)
17 17 |     pass

constant_literals.py:16:4: E711 [*] Comparison to `None` should be `cond is None`
   |
16 | if False == None:  # E711, E712 (fix)
17 |     pass
18 | if None == False:  # E711, E712 (fix)
   |    ^^^^ E711
19 |     pass
   |
   = help: Replace with `cond is None`

ℹ Suggested fix
13 13 |     pass
14 14 | if False == None:  # E711, E712 (fix)
15 15 |     pass
16    |-if None == False:  # E711, E712 (fix)
   16 |+if None is False:  # E711, E712 (fix)
17 17 |     pass
18 18 | 
19 19 | ###

constant_literals.py:16:12: E712 [*] Comparison to `False` should be `cond is False` or `if not cond:`
   |
16 | if False == None:  # E711, E712 (fix)
17 |     pass
18 | if None == False:  # E711, E712 (fix)
   |            ^^^^^ E712
19 |     pass
   |
   = help: Replace with `cond is False`

ℹ Suggested fix
13 13 |     pass
14 14 | if False == None:  # E711, E712 (fix)
15 15 |     pass
16    |-if None == False:  # E711, E712 (fix)
   16 |+if None is False:  # E711, E712 (fix)
17 17 |     pass
18 18 | 
19 19 | ###


