[Numpy-discussion] Rank-0 arrays - reprise

Nathaniel Smith njs@pobox....
Sun Jan 6 04:16:13 CST 2013

On 6 Jan 2013 07:59, "Dag Sverre Seljebotn" <d.s.seljebotn@astro.uio.no>
> Try to enumerate all the fundamentally different things (if you count
> memory use/running time) that can happen for ndarrays a, b, and
> arbitrary x here:
> a += b[x]
> That's already quite a lot, your proposal adds even more options. It's
> certainly a lot more complicated than str.

I agree it's complicated, but all the complications and options already
exist - they're just split across two similar-but-not-quite-identical sets
of data types.

> To me it all sounds like a lot of rules introduced just to have the
> result of a[0] be "kind of a scalar" without actually choosing that

Not sure what you mean here. We know that whatever object a[0] returns is
going to have scalar behaviour. Right now we have two totally different
implementations of scalars. I'm not suggesting changing any (or hardly any)
existing behaviour, just that we switch which implementation of that
behavior we use.

I actually wrote that email as kind of amusing exercise in "what if...?",
but even after sleeping on it I'm still not thinking of any terrible

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20130106/94150602/attachment.html 

More information about the NumPy-Discussion mailing list