On Mon, 2019-12-16 at 21:01 +0200, Matti Picus wrote:
> A code path and test have been in the code since NumPy 0.4 for a 
> two-argument variant of ``__array__(dtype=None, context=None)``. It
> was 
> activated when calling ``ufunc(op)`` or ``ufunc.reduce(op)`` if 
> ``op.__array__`` existed. However that variant is not documented, and
> it 
> is not clear what the intention was for its use.
> 
> 
> The code was something like
> 
> 
> try:
> 
>      op.__array__(dtype, context)
> 
> except TypeError:
> 
>      op.__array__(dtype)
> 
> 
> In PR 15118 https://github.com/numpy/numpy/pull/15118 I proposed to 
> remove this, so the call is now simply
> 
> 
> op.__array__(dtype)
> 
> 
> or `op.__array__()` if there is no dtype
> 
> 
> Does anyone need the undocumented two-argument variant?
> 

I agree, if nobody knows any usecase, I am for trying to remove it. It
seems like a Deprecation will not be super simple here. And since there
are no known use-cases, and any new use-case is better covered by
`__array_ufunc__` (and probably also `__array_wrap__`), removing this
simplifies an already tricky enough corner of NumPy.

Best,

Sebastian


> 
> Matti
> 
> 
> 
> 
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion

Attachment: signature.asc
Description: This is a digitally signed message part

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

Reply via email to