On Sun, Jun 3, 2018 at 5:44 PM Marten van Kerkwijk <
m.h.vankerkw...@gmail.com> wrote:

> Although I'm still not 100% convinced by NotImplementedButCoercible, I do
> like the idea that this is the default for items that do not implement
> `__array_function__`. And it might help avoid trying to find oneself in a
> possibly long list.
>

Another potential consideration in favor of NotImplementedButCoercible is
for subclassing: we could use it to write the default implementations of
ndarray.__array_ufunc__ and ndarray.__array_function__, e.g.,

class ndarray:
    def __array_ufunc__(self, *args, **kwargs):
        return NotIImplementedButCoercible
    def __array_function__(self, *args, **kwargs):
        return NotIImplementedButCoercible

I think (not 100% sure yet) this would result in exactly equivalent
behavior to what ndarray.__array_ufunc__ currently does:
http://www.numpy.org/neps/nep-0013-ufunc-overrides.html#subclass-hierarchies
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to