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?


Matti




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

Reply via email to