On Thu, May 27, 2010 at 2:34 PM, Charles R Harris
On Thu, May 27, 2010 at 9:59 AM,
wrote: A while ago we had a brief discussion about this.
Is this a feature? or should there be a ticket for this
np.sqrt('5') NotImplemented a = np.sqrt('5') a NotImplemented type(a)
What numpy version? I get
Obviously I'm too old (numpy 1.4.0) Josef
In [2]: sqrt(['a']) --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last)
/home/charris/<ipython console> in <module>()
NotImplementedError: Not implemented for this type
In [3]: sqrt('a') --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last)
/home/charris/<ipython console> in <module>()
NotImplementedError: Not implemented for this type
Which is entirely different. Note that Py_NotImplemented is *not* only for comparisons, it is a signal to the interpreter to try the r* version of a binary operator.
OTOH,
In [4]: maximum('a',1) Out[4]: NotImplemented
Which is still a problem. I think no ufunc should return NotImplemented, it should be reserved to methods so the interpreter will handle it correctly.
Chuck
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion