Hi All, Do indeed try __array_ufunc__! It should make many things work much better and possibly faster than was possible with __array_prepare__ and __array_wrap__ (for astropy's Quantity, an ndarray subclass than I maintain, it gets us a factor of almost 2 in speed for operations where scaling for units is needed; for array-like classes, it should enable things that were nearlyimpossible before).
About documentation, I'm not quite sure how to get the documentation on scipy.docs.org to update (the developer version points points to 1.13dev0 and is last updated in January). Beyond the links Nathaniel sent, there is also one more specifically aimed at subclasses: https://github.com/numpy/numpy/blob/master/numpy/doc/subclassing.py As noted, the API is provisional, which I hope it all the more reason to try it out if you think this could be useful -- and do let us know on github what works and what doesn't [e.g., there is a lively discussion on whether `ndarray` having its own `__array_ufunc__` for subclasses to super to is in fact a good idea -- for Quantity, I find it quite convenient (but then I implemented it...), but perhaps it is too confusing. See https://github.com/numpy/numpy/issues/9079 All the best, Marten _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@python.org https://mail.python.org/mailman/listinfo/numpy-discussion