[Numpy-discussion] BUG: ndarray subclass calls __mul__ when ** (pow) is involved

Dmitrey tmp50@ukr....
Sat Mar 19 14:35:01 CDT 2011


 I have ndarray subclass, its instance x and use
   r = x**2

   I expected it will call for each array element
   elem.__pow__(2)
   but it calls
   elem.__mul__(elem)
   instead.

   It essentially (tens or even more times) decreases my calculations
   speed for lots of cases.

   >>> numpy.__version__
   '2.0.0.dev-1fe8136'
   (taken some days ago from git)
   doesn't work with 1.3.0 as well..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110319/6f4c8602/attachment.html 


More information about the NumPy-Discussion mailing list