Assignment-Operator¶
Sourcery rule id: assignment-operator
¶
Description¶
Replace assignment with assignment operator
Before¶
x = x + 1
After¶
x += 1
Explanation¶
The augmented assignment operators, such as +=
are a more streamlined and easy to understand way
to add values. Using them removes a little bit of repetition and makes the code slightly easier to
understand.