[Numpy-discussion] segmentation fault

Alan McIntyre alan.mcintyre@gmail....
Wed May 28 14:17:10 CDT 2008


On Wed, May 28, 2008 at 1:37 PM, Charles R Harris
<charlesr.harris@gmail.com> wrote:
> I think the bug is not raising an error on shape mismatch, the assumption on
> the first index follows from that. For the out=x parameter, I propose the
> rules:
>
> 1) x must have the shape of the expected output (1D in this case)
> 2) x must have the same type as the expected output (currently cast)

That seems to be consistent with the documented behavior of other
functions that have an 'out' parameter.

I wonder if this is something that ought to be looked at for all
functions with an "out" parameter?  ndarray.compress also had problems
with array type mismatch (#789); I can't imagine that it's safe to
assume only these two functions were doing it incorrectly. (Unless of
course somebody has recently looked at all of them)

Alan


More information about the Numpy-discussion mailing list