[Numpy-discussion] segmentation fault

Charles R Harris charlesr.harris@gmail....
Wed May 28 14:34:07 CDT 2008

On Wed, May 28, 2008 at 1:17 PM, Alan McIntyre <alan.mcintyre@gmail.com>

> 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)

I think that is an excellent idea! A good start would be to list all the
functions with the out parameter and then write some tests. The current
behavior is inconsistent and we not only need to specify the behavior, but
fix all the places that don't follow the rules.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20080528/2907a967/attachment-0001.html 

More information about the Numpy-discussion mailing list