[Numpy-discussion] Revised NEP-18, __array_function__ protocol
Marten van Kerkwijk
m.h.vankerkwijk at gmail.com
Sat Jun 30 09:55:29 EDT 2018
On Fri, Jun 29, 2018 at 9:54 PM, Eric Wieser <wieser.eric+numpy at gmail.com>
> Good catch,
> I think the latter failing is because np.add.reduce ends up calling
> np.ufunc.reduce.__get__(np.add), and builtin_function.__get__ doesn’t
> appear to do any caching. I suppose caching bound methods would just be a
> waste of time.
> == would work just fine in my suggestion above, it seems - irrespective
> of the resolution of the discussion on python-dev.
I think for implementers it might work easiest anyway to look up the ufunc
itself in a dict or so and then check the name of the method. (At least,
for my impementations of `__array_ufunc__`, it made a lot of sense to use
the method in that way; possibly less so for the larger variety with other
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion