Maybe the best of both worlds would require explicit opt-in for classes that shouldn't be coerced, e.g.,
xarray.register_data_type(MyArray)

or maybe better yet ;)
xarray.void_my_nonexistent_warranty_its_my_fault_if_my_buggy_duck_array_breaks_everything(MyArray)

On Thu, Nov 2, 2017 at 3:39 PM Marten van Kerkwijk <m.h.vankerkwijk@gmail.com> wrote:
I guess my argument boils down to it being better to state that a
function only accepts arrays and happily let it break on, e.g.,
matrix, than use `asarray` to make a matrix into an array even though
it really isn't.

I do like the dtype ideas, but think I'd agree they're likely to come
with their own problems. But just making new numerical types possible
is interesting.

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