[Numpy-discussion] is __array_ufunc__ ready for prime-time?
Stephan Hoyer
shoyer at gmail.com
Thu Nov 2 20:33:38 EDT 2017
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 at 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 at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20171103/74a425e9/attachment.html>
More information about the NumPy-Discussion
mailing list