I'm using PyCharm and I have this statement:
a = 'foo'
b = 'bar'
a = b + a
and PyCharm highlights the last line saying that:
Assignment can be replaced with augmented assignment
First I thought there might be something like this but ended up with error:
a += b # 'foobar'
a =+ b # TypeError: bad operand type for unary +: 'str'
But 'foobar'
is not what I want; 'barfoo'
is.
So, what is this augmented assignment? Is there a more proper way to do this or should I ignore PyCharm's warning?