Re: __mul__ vs __rmul__ (and others) priority for different classes

2009-12-11 Thread Terry Reedy
dmitrey wrote: hi all, I have created a class MyClass and defined methods like __add__, __mul__, __pow__, __radd__, __rmul__ etc. Also, they are defined to work with numbers, Python lists and numpy.arrays. Both Python lists and numpy arrays have their own methods __add__, __mul__, __pow__, __rad

__mul__ vs __rmul__ (and others) priority for different classes

2009-12-11 Thread dmitrey
hi all, I have created a class MyClass and defined methods like __add__, __mul__, __pow__, __radd__, __rmul__ etc. Also, they are defined to work with numbers, Python lists and numpy.arrays. Both Python lists and numpy arrays have their own methods __add__, __mul__, __pow__, __radd__, __rmul__ etc