[Numpy-discussion] NEP 30 - Duck Typing for NumPy Arrays - Implementation

Peter Andreas Entschev peter at entschev.com
Tue Sep 17 09:54:21 EDT 2019


I see what you mean now. It was my misunderstanding, I thought you
wanted to return a call to __array__ when you call np.duckarray.

I agree with your point and understand how the current text may be
misleading, so we shall make it clearer in the NEP (as done in
https://github.com/numpy/numpy/pull/14529) that both are valid ways:

* Have a genuine implementation of __array__ (like Dask, as pointed
out by Stephan); or
* Raise an exception (as CuPy does).

Thanks for opening the PR, I will comment there as well.


More information about the NumPy-Discussion mailing list