Is there a way to overload += in python? [duplicate]
Solution 1:
Yes. Just override the object's __iadd__
method, which takes the same parameters as add
. You can find more information here.
Yes. Just override the object's __iadd__
method, which takes the same parameters as add
. You can find more information here.