[Numpy-discussion] np.equal

Pauli Virtanen pav@iki...
Mon Dec 7 03:36:12 CST 2009


su, 2009-12-06 kello 23:01 -0800, Fernando Perez kirjoitti:
> 2009/12/6 josef.pktd <josef.pktd@gmail.com>:
> >>>> np.equal(np.arange(5),'a')
> > NotImplemented
> 
> Why is NotImplemented a *return* value?  Normally NotImplementedError
> is a raised exception, but if it's not implemented, it shouldn't be
> returned as a value.

Maybe it is so because some code paths are shared with the == operation?

But in any case, NotImplemented should never be returned to the user --
I believe it's only meant to be an internal value used in determining
the proper comparison operation between values.

A bug ticket should be filed for this, I believe.

-- 
Pauli Virtanen



More information about the NumPy-Discussion mailing list