wemake-python-styleguide: Forbid incorrect assign pattern

Rule request

Thesis

We need to enforce:

a += b

instead of:

a = a + b

The same applies for all other operators: -, &, **, etc https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern

Reasoning

The first version is correct and short. This is a consistency rule.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (16 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks a lot, @slapshin!

Ok. We will not handle commutative cases in this rule