Re: [Numpy-discussion] missing array type
by Sasha other posts by this author
Feb 28 2006 11:03AM messages near this date
Re: [Numpy-discussion] missing array type
|
Re: [Numpy-discussion] missing array type
On 2/28/06, Christopher Barker <Chris.Barker@[...].gov> wrote:
> ...
> So what should the result of x += arange(5) be? I say it should raise an
> exception.
Agree. That's what I was proposing as a feasible (as opposed to ideal) solution.
Ideally, x += [1,1,1,1,1] would be fine, but not x += [1,2,1,2,1]. I
quoted too much
from an early post.
>
> Maybe zero-stride arrays are only really useful read-only?
>
Maybe. It is hard to justify x[1] = 2 changing the result of x[0], but
x[:] = 2 may still be ok.
> This is a complicated can of worms.....
Completely agree. That's why I made x.strides = 0 illegal some time
ago. I don't think it is a good idea to bring it back without
understanding all the consequences. If we allow it now, it will be
harder to change the behavior of the result later. Someone's code will
rely on x += ones(5) incrementing x five times for zero-stride x.
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Alan G Isaac
Sasha
David M. Cooke
Sasha
Tim Hochberg
Colin J. Williams
Sasha
Travis Oliphant
Sasha
Travis Oliphant
Christopher Barker
Sasha
Sasha
Travis Oliphant
Sasha
Alan G Isaac
|