---
source: crates/ruff_linter/src/rules/pylint/mod.rs
snapshot_kind: text
---
comparison_with_itself.py:2:1: PLR0124 Name compared with itself, consider replacing `foo == foo`
  |
1 | # Errors.
2 | foo == foo
  | ^^^ PLR0124
3 | 
4 | foo != foo
  |

comparison_with_itself.py:4:1: PLR0124 Name compared with itself, consider replacing `foo != foo`
  |
2 | foo == foo
3 | 
4 | foo != foo
  | ^^^ PLR0124
5 | 
6 | foo > foo
  |

comparison_with_itself.py:6:1: PLR0124 Name compared with itself, consider replacing `foo > foo`
  |
4 | foo != foo
5 | 
6 | foo > foo
  | ^^^ PLR0124
7 | 
8 | foo >= foo
  |

comparison_with_itself.py:8:1: PLR0124 Name compared with itself, consider replacing `foo >= foo`
   |
 6 | foo > foo
 7 | 
 8 | foo >= foo
   | ^^^ PLR0124
 9 | 
10 | foo < foo
   |

comparison_with_itself.py:10:1: PLR0124 Name compared with itself, consider replacing `foo < foo`
   |
 8 | foo >= foo
 9 | 
10 | foo < foo
   | ^^^ PLR0124
11 | 
12 | foo <= foo
   |

comparison_with_itself.py:12:1: PLR0124 Name compared with itself, consider replacing `foo <= foo`
   |
10 | foo < foo
11 | 
12 | foo <= foo
   | ^^^ PLR0124
13 | 
14 | foo is foo
   |

comparison_with_itself.py:14:1: PLR0124 Name compared with itself, consider replacing `foo is foo`
   |
12 | foo <= foo
13 | 
14 | foo is foo
   | ^^^ PLR0124
15 | 
16 | foo is not foo
   |

comparison_with_itself.py:16:1: PLR0124 Name compared with itself, consider replacing `foo is not foo`
   |
14 | foo is foo
15 | 
16 | foo is not foo
   | ^^^ PLR0124
17 | 
18 | foo in foo
   |

comparison_with_itself.py:18:1: PLR0124 Name compared with itself, consider replacing `foo in foo`
   |
16 | foo is not foo
17 | 
18 | foo in foo
   | ^^^ PLR0124
19 | 
20 | foo not in foo
   |

comparison_with_itself.py:20:1: PLR0124 Name compared with itself, consider replacing `foo not in foo`
   |
18 | foo in foo
19 | 
20 | foo not in foo
   | ^^^ PLR0124
21 | 
22 | id(foo) == id(foo)
   |

comparison_with_itself.py:22:1: PLR0124 Name compared with itself, consider replacing `id(foo) == id(foo)`
   |
20 | foo not in foo
21 | 
22 | id(foo) == id(foo)
   | ^^^^^^^ PLR0124
23 | 
24 | len(foo) == len(foo)
   |

comparison_with_itself.py:24:1: PLR0124 Name compared with itself, consider replacing `len(foo) == len(foo)`
   |
22 | id(foo) == id(foo)
23 | 
24 | len(foo) == len(foo)
   | ^^^^^^^^ PLR0124
25 | 
26 | # Non-errors.
   |
