[Numpy-discussion] NEP: Dispatch Mechanism for NumPy’s high level API

Stephan Hoyer shoyer at gmail.com
Tue Jun 5 18:03:32 EDT 2018

On Tue, Jun 5, 2018 at 2:47 PM Matti Picus <matti.picus at gmail.com> wrote:

> What is the difference between the `func` provided as the first argument
> to `__array_function__` and `__array_ufunc__` and the "non-overloaded
> version of the provided function"?

The ""non-overloaded version of the provided function" is entirely
hypothetical at this point.

If we use a decorator to implement overloads, it would be the undecorated
function, e.g., the original definition of concatenate here:

@overload_for_array_function(['arrays', 'out'])def concatenate(arrays,
axis=0, out=None):
    ... # continue with the definition of concatenate

This NEP calls it an "arbitrary callable".
> In `__array_ufunc__` it turns out people count on it being exactly the
> `np.ufunc`.

Right, I think this is good guarantee to provide. Certainly it's one that
people fine useful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180605/be907956/attachment.html>

More information about the NumPy-Discussion mailing list