First, we have to briefly talk about how the operators, e.g., for "addition" are implemented in Python.

There are basically two different add methods for the + operator:

a.__add__(b) Returns the sum of a and b in a + b

a.__iadd__(b)

Changes the value a in place, e.g., a += b

However, the __iadd__ method supports only mutable types. Thus, if we use the in-place operator += on, for example, integers (integers are immutable), Python simulates the __iadd__ method: