[Numpy-discussion] Segfault with dodgy type descriptors

Ed Schofield schofield at ftw.at
Sun Jan 29 08:34:06 CST 2006

Hi Travis,

Here's a segfault from the crazy input department:

>>> cs = [('A', 1), ('B', 2)]
>>> a = numpy.array(cs, dtype=(object,5))

Using the descriptor dtype=(object,x) for other values of x gives
varying results, but all of them should probably raise a ValueError.

On a related note, it seems that it's now possible again to use an array
as a dtype.  You changed this behaviour in November after I suggested
that this should be illegal.  (See
http://www.scipy.net/pipermail/scipy-dev/2005-November/004126.html).  My
argument then was that calling array(a, b.dtype) is clearer and safer
than using array(a, b), which can be confused with array((a,b)).  Is it
an oversight that arrays can again be used as dtypes?

-- Ed

More information about the Numpy-discussion mailing list