[Numpy-discussion] "Manually" broadcasting arrays in Python

Stefan van der Walt stefan at sun.ac.za
Fri Oct 6 13:33:40 EDT 2006


On Wed, Oct 04, 2006 at 01:37:55AM -0400, A. M. Archibald wrote:
> Would it be useful for me to contribute the tiny script I wrote to
> trigger it as a regression test?
> 
> A. M. Archibald
> 
> from numpy import vectorize, zeros
> 
> vt = vectorize(lambda *args: args)
> # Removing either of the following lines cures the segfault
> vt(zeros((1,2,1)), zeros((2,1,1)), zeros((1,1,2)))
> vt(zeros((1,2,1)), zeros((2,1,1)), zeros((1,1,2)), zeros((2,2)))

I also get a segfault when running this, but the strange thing is that
I can't catch it with valgrind (which also segfaults).

I've filed a ticket at

http://projects.scipy.org/scipy/numpy/ticket/325

Regards
Stéfan




More information about the NumPy-Discussion mailing list