[Numpy-discussion] Adding to the non-dispatched implementation of NumPy methods

Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Tue Apr 16 09:42:50 EDT 2019

I somewhat share Nathaniel's worry that by providing
`__numpy_implementation__` we essentially get stuck with the
implementations we have currently, rather than having the hoped-for freedom
to remove all the `np.asarray` coercion. In that respect, an advantage of
using `_wrapped` is that it is clearly a private method, so anybody is
automatically forewarned that this can change.

In principle, ndarray.__array_function__ would be more logical, but as
noted in the PR, the problem is that it is non-trivial for a regular
__array_function__ implementation to coerce all the arguments to ndarray

Which suggests that perhaps what is missing is a general routine that does
that, i.e., that re-uses the dispatcher.

-- Marten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190416/9a4ed556/attachment.html>

More information about the NumPy-Discussion mailing list