[Numpy-discussion] Revised NEP-18, __array_function__ protocol
shoyer at gmail.com
Fri Jun 29 21:23:15 EDT 2018
On Thu, Jun 28, 2018 at 5:36 PM Eric Wieser <wieser.eric+numpy at gmail.com>
> Another option would be to directly compare the methods against known ones:
> obj = func.__self__
> if isinstance(obj, np.ufunc):
> if func is obj.reduce:
> I'm not quite sure why, but this doesn't seem to work with current ufunc
>>> np.add.reduce == np.add.reduce # OK
>>> np.add.reduce is np.add.reduce # what?!?
Maybe this is a bug? There's been some somewhat related discussion recently
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion