[NumPy-Tickets] [NumPy] #1333: exclude ndarray operations __mul__, __pow__ etc

NumPy Trac numpy-tickets@scipy....
Sun Sep 5 15:49:41 CDT 2010


#1333: exclude ndarray operations __mul__, __pow__ etc
------------------------+---------------------------------------------------
 Reporter:  dmitrey     |       Owner:  somebody      
     Type:  defect      |      Status:  needs_decision
 Priority:  high        |   Milestone:                
Component:  numpy.core  |     Version:                
 Keywords:              |  
------------------------+---------------------------------------------------

Comment(by charris):

 The detection of __array_priority__ is in the ufuncs though, not the
 ndarray class itself. I suppose one could argue that that makes the
 behavior depend on the implementation details of ndarray rather than being
 intrinsic. Even so, having some way to make the ufuncs reject certain
 objects is a plus.

 {{{
 In [4]: from numpy.polynomial import Polynomial as P

 In [5]: multiply(ones(2), P([1,2]))
 Out[5]: NotImplemented

 In [6]: ones(2) * P([1,2])
 Out[6]: Polynomial([ 1.,  3.,  2.], [-1.,  1.])

 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/1333#comment:3>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list