Is there a way to overload += in python? [duplicate] Is there a way to overload += in python? [duplicate] python python

Is there a way to overload += in python? [duplicate]


Yes. Just override the object's __iadd__ method, which takes the same parameters as add. You can find more information here.