[Numpy-discussion] __array_ufunc__ counting down to launch, T-24 hrs.
Marten van Kerkwijk
m.h.vankerkwijk at gmail.com
Fri Mar 31 13:41:12 EDT 2017
That is a good point: Yes, one can leave __array_prepare__ and
__array_wrap__ in place: only for ufuncs will they be ignored if
__array_ufunc__ is present; __array_wrap__ in particular will still be
used by quite a lot of other numpy functions (other use of
__array_prepare__ is usually a mistake, but sadly does happen...).
Anyway, with older versions of numpy, code should continue to work as it did.
All the best,
p.s. It is also important to leave __array_prepare__ and
__array_wrap__ in place for possible other classes that assume your
class is wrapped that way...
p.s.2 The same holds for __array_priority__
More information about the NumPy-Discussion