[Numpy-discussion] Adding to the non-dispatched implementation of NumPy methods
shoyer at gmail.com
Fri May 10 22:04:18 EDT 2019
On Sat, May 4, 2019 at 12:29 PM Ralf Gommers <ralf.gommers at gmail.com> wrote:
> We seem to have run out of steam a bit here.
We discussed this today in person at the NumPy sprint.
The consensus was to go for a name like __skip_array_function__. Ufuncs
don't have very good use-cases for a function that skips dispatch:
1. The overhead of the ufunc dispatch machinery is much smaller, especially
in the case where all arguments are NumPy arrays, because there is no need
for a wrapper function in Python.
2. Inside __array_ufunc__ it's possible to cast arguments into NumPy arrays
explicitly and then call the ufunc again. There's no need to explicitly
We also don't really care about supporting the use-case where a function
gets changed into a ufunc. We already warn users not to call
__skip_array_function__ directly (without using getattr) outside
Given all this, it seems best to stick with a name that mirrors
__array_function__ as closely as possible. I picked "skip" instead of
"skpping" just because it's slightly shorter, but otherwise don't have a
I've edited the NEP  and implementation  pull requests to use this
new name, and clarify the use-cases. If there no serious objections, I'd
love to merge these soon, in time for the NumPy 1.17 release candidate.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion