[SciPy-dev] numpy.float64*poly1d = array

Ryan Krauss ryanlists@gmail....
Wed Sep 5 21:52:43 CDT 2007

I filed a ticket for this and I guess it is technically a numpy
problem, but I am curious about it.  One line recreates the problem
for me:


array([ 10., -10.])

I went in and added a little debugging print statement to the __mul__
and __rmul__ methods of poly1d, and neither is called when the
numpy.float64 instance is on the left.

calls __mul__ and works fine.

calls __rmul__ and works fine.

I got myself in this situation by multiplying a poly1d by a constant
taken from an array, which is a numpy.float64 instance.

This seems to indicate that

is handled entirely by the float64 __mul__ method without calling
__rmul__ of poly1d.  Does that seem possible?  I think that is what is
happening because my cheesy
print('in rmul')  statement isn't triggered.



More information about the Scipy-dev mailing list