---
source: crates/ruff_linter/src/rules/pyflakes/mod.rs
---
F632 [*] Use `==` to compare constant literals
 --> F632.py:1:4
  |
1 | if x is "abc":
  |    ^^^^^^^^^^
2 |     pass
  |
help: Replace `is` with `==`
  |
  - if x is "abc":
1 + if x == "abc":
2 |     pass
  |

F632 [*] Use `!=` to compare constant literals
 --> F632.py:4:4
  |
2 |     pass
3 |
4 | if 123 is not y:
  |    ^^^^^^^^^^^^
5 |     pass
  |
help: Replace `is not` with `!=`
  |
3 |
  - if 123 is not y:
4 + if 123 != y:
5 |     pass
  |

F632 [*] Use `!=` to compare constant literals
 --> F632.py:7:4
  |
5 |       pass
6 |
7 |   if 123 is \
  |  ____^
8 | |         not y:
  | |_____________^
9 |       pass
  |
help: Replace `is not` with `!=`
  |
6 |
  - if 123 is \
  -         not y:
7 + if 123 != y:
8 |     pass
  |

F632 [*] Use `==` to compare constant literals
  --> F632.py:11:4
   |
 9 |     pass
10 |
11 | if "123" is x < 3:
   |    ^^^^^^^^^^^^^^
12 |     pass
   |
help: Replace `is` with `==`
   |
10 |
   - if "123" is x < 3:
11 + if "123" == x < 3:
12 |     pass
   |

F632 [*] Use `==` to compare constant literals
  --> F632.py:14:4
   |
12 |     pass
13 |
14 | if "123" != x is 3:
   |    ^^^^^^^^^^^^^^^
15 |     pass
   |
help: Replace `is` with `==`
   |
13 |
   - if "123" != x is 3:
14 + if "123" != x == 3:
15 |     pass
   |

F632 [*] Use `==` to compare constant literals
  --> F632.py:17:4
   |
15 |     pass
16 |
17 | if ("123" != x) is 3:
   |    ^^^^^^^^^^^^^^^^^
18 |     pass
   |
help: Replace `is` with `==`
   |
16 |
   - if ("123" != x) is 3:
17 + if ("123" != x) == 3:
18 |     pass
   |

F632 [*] Use `==` to compare constant literals
  --> F632.py:20:14
   |
18 |     pass
19 |
20 | if "123" != (x is 3):
   |              ^^^^^^
21 |     pass
   |
help: Replace `is` with `==`
   |
19 |
   - if "123" != (x is 3):
20 + if "123" != (x == 3):
21 |     pass
   |

F632 [*] Use `!=` to compare constant literals
  --> F632.py:23:2
   |
21 |       pass
22 |
23 |   {2 is
   |  __^
24 | | not ''}
   | |______^
25 |
26 |   {2 is
   |
help: Replace `is not` with `!=`
   |
22 |
   - {2 is
   - not ''}
23 + {2 != ''}
24 |
   |

F632 [*] Use `!=` to compare constant literals
  --> F632.py:26:2
   |
24 |   not ''}
25 |
26 |   {2 is
   |  __^
27 | |  not ''}
   | |_______^
28 |
29 |   # Regression test for
   |
help: Replace `is not` with `!=`
   |
25 |
   - {2 is
   -  not ''}
26 + {2 != ''}
27 |
   |

F632 [*] Use `!=` to compare constant literals
  --> F632.py:30:4
   |
29 | # Regression test for
30 | if values[1is not None ] is not '-':
   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
31 |     pass
   |
help: Replace `is not` with `!=`
   |
29 | # Regression test for
   - if values[1is not None ] is not '-':
30 + if values[1is not None ] != '-':
31 |     pass
   |

F632 [*] Use `!=` to compare constant literals
  --> F632.py:30:11
   |
29 | # Regression test for
30 | if values[1is not None ] is not '-':
   |           ^^^^^^^^^^^^
31 |     pass
   |
help: Replace `is not` with `!=`
   |
29 | # Regression test for
   - if values[1is not None ] is not '-':
30 + if values[1!= None ] is not '-':
31 |     pass
   |

F632 [*] Use `!=` to compare constant literals
  --> F632.py:34:12
   |
33 | # Regression test for https://github.com/astral-sh/ruff/issues/11736
34 | variable: "123 is not y"
   |            ^^^^^^^^^^^^
   |
help: Replace `is not` with `!=`
   |
33 | # Regression test for https://github.com/astral-sh/ruff/issues/11736
   - variable: "123 is not y"
34 + variable: "123 != y"
   |
