---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLW0127 Self-assignment of variable `foo`
 --> self_assigning_variable.py:6:1
  |
5 | # Errors.
6 | foo = foo
  | ^^^
7 | bar = bar
8 | foo, bar = foo, bar
  |

PLW0127 Self-assignment of variable `bar`
 --> self_assigning_variable.py:7:1
  |
5 | # Errors.
6 | foo = foo
7 | bar = bar
  | ^^^
8 | foo, bar = foo, bar
9 | bar, foo = bar, foo
  |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:8:1
   |
 6 | foo = foo
 7 | bar = bar
 8 | foo, bar = foo, bar
   | ^^^
 9 | bar, foo = bar, foo
10 | (foo, bar) = (foo, bar)
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:8:6
   |
 6 | foo = foo
 7 | bar = bar
 8 | foo, bar = foo, bar
   |      ^^^
 9 | bar, foo = bar, foo
10 | (foo, bar) = (foo, bar)
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:9:1
   |
 7 | bar = bar
 8 | foo, bar = foo, bar
 9 | bar, foo = bar, foo
   | ^^^
10 | (foo, bar) = (foo, bar)
11 | (bar, foo) = (bar, foo)
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:9:6
   |
 7 | bar = bar
 8 | foo, bar = foo, bar
 9 | bar, foo = bar, foo
   |      ^^^
10 | (foo, bar) = (foo, bar)
11 | (bar, foo) = (bar, foo)
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:10:2
   |
 8 | foo, bar = foo, bar
 9 | bar, foo = bar, foo
10 | (foo, bar) = (foo, bar)
   |  ^^^
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:10:7
   |
 8 | foo, bar = foo, bar
 9 | bar, foo = bar, foo
10 | (foo, bar) = (foo, bar)
   |       ^^^
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:11:2
   |
 9 | bar, foo = bar, foo
10 | (foo, bar) = (foo, bar)
11 | (bar, foo) = (bar, foo)
   |  ^^^
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:11:7
   |
 9 | bar, foo = bar, foo
10 | (foo, bar) = (foo, bar)
11 | (bar, foo) = (bar, foo)
   |       ^^^
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:12:1
   |
10 | (foo, bar) = (foo, bar)
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
   | ^^^
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:12:7
   |
10 | (foo, bar) = (foo, bar)
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
   |       ^^^
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
   |

PLW0127 Self-assignment of variable `baz`
  --> self_assigning_variable.py:12:12
   |
10 | (foo, bar) = (foo, bar)
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
   |            ^^^
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:13:1
   |
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
   | ^^^
14 | (foo, bar), baz = (foo, bar), baz
15 | (foo, (bar, baz)) = (foo, (bar, baz))
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:13:7
   |
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
   |       ^^^
14 | (foo, bar), baz = (foo, bar), baz
15 | (foo, (bar, baz)) = (foo, (bar, baz))
   |

PLW0127 Self-assignment of variable `baz`
  --> self_assigning_variable.py:13:12
   |
11 | (bar, foo) = (bar, foo)
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
   |            ^^^
14 | (foo, bar), baz = (foo, bar), baz
15 | (foo, (bar, baz)) = (foo, (bar, baz))
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:14:2
   |
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
   |  ^^^
15 | (foo, (bar, baz)) = (foo, (bar, baz))
16 | foo, bar = foo, 1
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:14:7
   |
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
   |       ^^^
15 | (foo, (bar, baz)) = (foo, (bar, baz))
16 | foo, bar = foo, 1
   |

PLW0127 Self-assignment of variable `baz`
  --> self_assigning_variable.py:14:13
   |
12 | foo, (bar, baz) = foo, (bar, baz)
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
   |             ^^^
15 | (foo, (bar, baz)) = (foo, (bar, baz))
16 | foo, bar = foo, 1
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:15:2
   |
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
15 | (foo, (bar, baz)) = (foo, (bar, baz))
   |  ^^^
16 | foo, bar = foo, 1
17 | bar, foo = bar, 1
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:15:8
   |
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
15 | (foo, (bar, baz)) = (foo, (bar, baz))
   |        ^^^
16 | foo, bar = foo, 1
17 | bar, foo = bar, 1
   |

PLW0127 Self-assignment of variable `baz`
  --> self_assigning_variable.py:15:13
   |
13 | bar, (foo, baz) = bar, (foo, baz)
14 | (foo, bar), baz = (foo, bar), baz
15 | (foo, (bar, baz)) = (foo, (bar, baz))
   |             ^^^
16 | foo, bar = foo, 1
17 | bar, foo = bar, 1
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:16:1
   |
14 | (foo, bar), baz = (foo, bar), baz
15 | (foo, (bar, baz)) = (foo, (bar, baz))
16 | foo, bar = foo, 1
   | ^^^
17 | bar, foo = bar, 1
18 | (foo, bar) = (foo, 1)
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:17:1
   |
15 | (foo, (bar, baz)) = (foo, (bar, baz))
16 | foo, bar = foo, 1
17 | bar, foo = bar, 1
   | ^^^
18 | (foo, bar) = (foo, 1)
19 | (bar, foo) = (bar, 1)
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:18:2
   |
16 | foo, bar = foo, 1
17 | bar, foo = bar, 1
18 | (foo, bar) = (foo, 1)
   |  ^^^
19 | (bar, foo) = (bar, 1)
20 | foo, (bar, baz) = foo, (bar, 1)
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:19:2
   |
17 | bar, foo = bar, 1
18 | (foo, bar) = (foo, 1)
19 | (bar, foo) = (bar, 1)
   |  ^^^
20 | foo, (bar, baz) = foo, (bar, 1)
21 | bar, (foo, baz) = bar, (foo, 1)
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:20:1
   |
18 | (foo, bar) = (foo, 1)
19 | (bar, foo) = (bar, 1)
20 | foo, (bar, baz) = foo, (bar, 1)
   | ^^^
21 | bar, (foo, baz) = bar, (foo, 1)
22 | (foo, bar), baz = (foo, bar), 1
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:20:7
   |
18 | (foo, bar) = (foo, 1)
19 | (bar, foo) = (bar, 1)
20 | foo, (bar, baz) = foo, (bar, 1)
   |       ^^^
21 | bar, (foo, baz) = bar, (foo, 1)
22 | (foo, bar), baz = (foo, bar), 1
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:21:1
   |
19 | (bar, foo) = (bar, 1)
20 | foo, (bar, baz) = foo, (bar, 1)
21 | bar, (foo, baz) = bar, (foo, 1)
   | ^^^
22 | (foo, bar), baz = (foo, bar), 1
23 | (foo, (bar, baz)) = (foo, (bar, 1))
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:21:7
   |
19 | (bar, foo) = (bar, 1)
20 | foo, (bar, baz) = foo, (bar, 1)
21 | bar, (foo, baz) = bar, (foo, 1)
   |       ^^^
22 | (foo, bar), baz = (foo, bar), 1
23 | (foo, (bar, baz)) = (foo, (bar, 1))
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:22:2
   |
20 | foo, (bar, baz) = foo, (bar, 1)
21 | bar, (foo, baz) = bar, (foo, 1)
22 | (foo, bar), baz = (foo, bar), 1
   |  ^^^
23 | (foo, (bar, baz)) = (foo, (bar, 1))
24 | foo: int = foo
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:22:7
   |
20 | foo, (bar, baz) = foo, (bar, 1)
21 | bar, (foo, baz) = bar, (foo, 1)
22 | (foo, bar), baz = (foo, bar), 1
   |       ^^^
23 | (foo, (bar, baz)) = (foo, (bar, 1))
24 | foo: int = foo
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:23:2
   |
21 | bar, (foo, baz) = bar, (foo, 1)
22 | (foo, bar), baz = (foo, bar), 1
23 | (foo, (bar, baz)) = (foo, (bar, 1))
   |  ^^^
24 | foo: int = foo
25 | bar: int = bar
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:23:8
   |
21 | bar, (foo, baz) = bar, (foo, 1)
22 | (foo, bar), baz = (foo, bar), 1
23 | (foo, (bar, baz)) = (foo, (bar, 1))
   |        ^^^
24 | foo: int = foo
25 | bar: int = bar
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:24:1
   |
22 | (foo, bar), baz = (foo, bar), 1
23 | (foo, (bar, baz)) = (foo, (bar, 1))
24 | foo: int = foo
   | ^^^
25 | bar: int = bar
26 | foo = foo = bar
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:25:1
   |
23 | (foo, (bar, baz)) = (foo, (bar, 1))
24 | foo: int = foo
25 | bar: int = bar
   | ^^^
26 | foo = foo = bar
27 | (foo, bar) = (foo, bar) = baz
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:26:1
   |
24 | foo: int = foo
25 | bar: int = bar
26 | foo = foo = bar
   | ^^^
27 | (foo, bar) = (foo, bar) = baz
28 | (foo, bar) = baz = (foo, bar) = 1
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:27:2
   |
25 | bar: int = bar
26 | foo = foo = bar
27 | (foo, bar) = (foo, bar) = baz
   |  ^^^
28 | (foo, bar) = baz = (foo, bar) = 1
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:27:7
   |
25 | bar: int = bar
26 | foo = foo = bar
27 | (foo, bar) = (foo, bar) = baz
   |       ^^^
28 | (foo, bar) = baz = (foo, bar) = 1
   |

PLW0127 Self-assignment of variable `foo`
  --> self_assigning_variable.py:28:2
   |
26 | foo = foo = bar
27 | (foo, bar) = (foo, bar) = baz
28 | (foo, bar) = baz = (foo, bar) = 1
   |  ^^^
29 |
30 | # Non-errors.
   |

PLW0127 Self-assignment of variable `bar`
  --> self_assigning_variable.py:28:7
   |
26 | foo = foo = bar
27 | (foo, bar) = (foo, bar) = baz
28 | (foo, bar) = baz = (foo, bar) = 1
   |       ^^^
29 |
30 | # Non-errors.
   |
