The Remarks Section says
Equivalent to A = A + B.
But that is not true. += operator uses __iadd__
method, if it is defined.
If it's not defined, then it uses the __add__
method.
__iadd__
method does addition in place.
__add__
method adds the two objects and returns a new object.
In depth discussion can be found here : https://stackoverflow.com/a/2347423/13345708
The Remarks can be edited to say
Equivalent to A = A + B, if iadd method is not defined