[Numpy-discussion] Proposal to accept NEP-18, __array_function__ protocol

Ralf Gommers ralf.gommers at gmail.com
Wed Aug 22 11:15:38 EDT 2018


On Wed, Aug 22, 2018 at 4:22 AM Hameer Abbasi <einstein.edison at gmail.com>
wrote:

> May I propose an alternative that was already discussed, and one that I
> think everyone will be okay with:
>

That's a dangerous assumption on this list:)

We put all overridable functions inside a new submodule, numpy.api, that
> will initially be a shallow-ish copy of the numpy module.
>

This is not desirable. There are projects (e.g. statsmodels) that have
added a .api submodule before. It's generally considered not a good idea,
it's not very Pythonic. Everything one can import that doesn't have an
underscore is normally part of the API of a package. In this particular
case, I definitely prefer an envvar and relying on what is documented as
part of __array_function__ rather than a new namespace.

Cheers,
Ralf

I say ish because all modules inside NumPy will need to be shallow-copied
> as well. If we need to add __array_function__, we can always do that there.
> Normal users are using “regular” NumPy unless they know they’re using the
> API, but it is separately accessible. As for hiding it completely goes: We
> have to realise, the Python computation landscape is fragmenting. The
> slower we are, the more fragmented it will become. NumPy already isn’t “the
> standard” for machine learning.
>
> Regards,
> Hameer Abbasi
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180822/920668b7/attachment.html>


More information about the NumPy-Discussion mailing list