On Wed, May 2, 2018 at 8:39 AM Marten van Kerkwijk <
m.h.vankerkw...@gmail.com> wrote:

> I think we should not decide too readily on what is "reasonable" to
> expect for a ufunc input.
>

I agree strongly with this.

I can think of a couple of other use-cases off hand:
- xarray.Dataset is a dict-like container of multiple arrays.
Matrix-multiplication with a numpy array could make sense (just map over
all the contained arrays), but xarray.Dataset itself is not an array and
thus does not define shape.
- tensorflow.Tensor can have a dynamic shape that is only known when
computation is explicitly run, not when computation is defined in Python.

The problem is even bigger for np.matmul because NumPy also wants to use
the same logic for overriding @, and Python's built-in operators definitely
should not have such restrictions.
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to