---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLC1901 `x is ""` can be simplified to `not x` as an empty string is falsey
 --> compare_to_empty_string.py:7:13
  |
6 | def errors():
7 |     if x is "" or x == "":
  |             ^^
8 |         print("x is an empty string")
  |

PLC1901 `x == ""` can be simplified to `not x` as an empty string is falsey
 --> compare_to_empty_string.py:7:24
  |
6 | def errors():
7 |     if x is "" or x == "":
  |                        ^^
8 |         print("x is an empty string")
  |

PLC1901 `y is not ""` can be simplified to `y` as an empty string is falsey
  --> compare_to_empty_string.py:10:17
   |
 8 |         print("x is an empty string")
 9 |
10 |     if y is not "" or y != "":
   |                 ^^
11 |         print("y is not an empty string")
   |

PLC1901 `y != ""` can be simplified to `y` as an empty string is falsey
  --> compare_to_empty_string.py:10:28
   |
 8 |         print("x is an empty string")
 9 |
10 |     if y is not "" or y != "":
   |                            ^^
11 |         print("y is not an empty string")
   |

PLC1901 `"" != z` can be simplified to `z` as an empty string is falsey
  --> compare_to_empty_string.py:13:8
   |
11 |         print("y is not an empty string")
12 |
13 |     if "" != z:
   |        ^^
14 |         print("z is an empty string")
   |
