Is there a way to do arithmetic on python class objects, and all the operations will be applied to one attribute automatically. For example:
>>> x = Struct(__data__ = [100,100])
>>> y = Struct(__data__ = [200,200])
>>> x + y
Struct(__data__ = [300,300])
>>> np.array(x) + np.array(y)
np.array(Struct(__data__ = [300,300]))
>>> x += y
x ==> Struct(__data__ = [300,300])
>>> x[1:] = 50
x ==> Struct(__data__ = [300,50])
I want it to perform like a normal number/array, and all the operations apply to .__data__
automatically.