[Numpy-tickets] [NumPy] #423: clip segfaults when using out argument with non-expected datatype
NumPy
numpy-tickets at scipy.net
Sun Jan 14 23:05:27 CST 2007
#423: clip segfaults when using out argument with non-expected datatype
------------------------------+---------------------------------------------
Reporter: david cournapeau | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone:
Component: Other | Version: devel
Severity: normal | Resolution:
Keywords: clip |
------------------------------+---------------------------------------------
Comment (by david cournapeau):
(sorry for the bad formatting) The clip function segfaults when using a
out argument which does not have the expected type:
{{{
#!python
import numpy as N
a = N.linspace(0, 10, 100).astype(numpy.int32)
m = N.int32(0) M = N.int32(1)
# works
a.clip(m, M)
b = N.zeros(a.shape, dtype = N.int32)
# works a.clip(m, M, out = b)
b = N.zeros(a.shape, dtype = N.int64)
# always segfaults
a.clip(m, M, out = b)
}}}
This is with a recent SVN numpy ('1.0.2.dev3510').
--
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/423#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list