[Numpy-discussion] New Indexing Methods Revival #N (subclasses!)

Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Mon Sep 5 14:54:07 EDT 2016


Hi Sebastian,

Indeed, having the scalar pass through `__array_wrap__` would have
been useful (_finalize__ is too late, since one cannot change the
class any more, just set attributes).  But that is water under the
bridge, since we're stuck with people not expecting that.

I think the slightly larger question, but one somewhat orthogonal to
your suggestion of a new dundermethod, is whether one cannot avoid
more such methods by the new indexing routines returning array scalars
instead of regular ones.

Obviously, though, this has larger scope, as it might be part of the
merging of the now partially separate code paths for scalar and array
arithmetic, etc.

All the best,

Marten



More information about the NumPy-Discussion mailing list