On Wed, Sep 26, 2018 at 9:19 AM Joris Van den Bossche <
jorisvandenboss...@gmail.com> wrote:

> Hi all,
>
> I have small question for clarification regarding some reducing numpy
> functions like np.sum, np.mean, etc, i.e. functions that now work on
> other array-like objects by checking if they have 'sum', 'mean', etc method
> and if so, "dispatch" to the method.
> Those functions are several times mentioned as examples in the text of the
> NEP, so although the NEP does not list the functions that will use the
> __array_function__ protocol explicitly, I assume that those functions
> will probably be in that list. But I wanted to check if that assumption is
> correct.
>
> Is it the intent that the functions that now dispatch to object methods
> will be updated to use the protocol instead? (probably keeping to
> method-dispatch as second try for backwards compatibility)
>

Hi Joris,

Yes, this is my exact intent. Eventually, we might remove/deprecate
automatically calling methods with the same name (due to how error prone
this is), but that is a long way in the future if ever.

Keep in mind that the current version of the NEP may not be a good fit for
pandas, because it requires overriding *all* NumPy functions. See this
section of the NEP for details:
http://www.numpy.org/neps/nep-0018-array-function-protocol.html#coercion-to-a-numpy-array-as-a-catch-all-fallback

Cheers,
Stephan
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to