On Fri, Feb 4, 2011 at 2:23 PM, Lluís <[email protected]> wrote: > Darren Dale writes: > >> With generic functions, you wouldn't have to remember to use the ufunc >> provided by masked array for one type, or the default numpy for >> another type. > > Sorry, but I don't see how generic functions should be a better approach > compared to redefining methods on masked_array [1]. In both cases you > have to define them one-by-one. > > [1] assuming 'np.foo' and 'ma.foo' (which would now be obsolete) simply > call 'instance.foo', which in the ndarray level is the 'foo' ufunc > object.
That's a bad assumption. np.ndarray.__add__ actually calls the np.add ufunc, not the other way around. For example, np.arcsin is a ufunc that operates on ndarray, yet there is no ndarray.arcsin method. Darren _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
