[Numpy-discussion] Segfault with dodgy type descriptors
schofield at ftw.at
Sun Jan 29 08:34:06 CST 2006
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
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?
More information about the Numpy-discussion