+= operator in python for __setitem__ (addition in place for square brackets)

Viewed 791

To define a class behaviour in the following statement:

my_object[item] = ...

I know I need to define the __setitem__ method.

What method do I need to define for the following statement:

my_object[item] += ...
2 Answers
Related