[Numpy-discussion] Inconsistency in dtype.arrdescr?

Travis Oliphant oliphant.travis at ieee.org
Mon Jan 16 14:27:02 CST 2006


Colin J. Williams wrote:

> Francesc Altet wrote:
>
>> Hi,
>>
>> I find the next a bit misleading:
>>
>>  
>>
>>>>> numpy.array((3,), dtype='u4').dtype.arrdescr
>>>>>       
>>>>
>> [('', '<u4')]
>>
>> but...
>>
>>  
>>
>>>>> numpy.zeros((3,), dtype='u4,u2').dtype.arrdescr
>>>>>       
>>>>
>> [('f1', '<u4'), ('f2', '<u2')]
>>
>> I think it would be more consistent if the former expression would give
>> as output:
>>
>> [('f1', '<u4')]
>>
>> Cheers,
>>
>>  
>>
> Why not respond with a simple character string, such as f1, <u4?


This attribute retrieves a description of the type using the array 
interface descriptor format, which has a pre-specified structure.   So, 
any changes to this format are changes to the interface which of course 
can always be discussed, but should be discussed in that context.

-Travis





More information about the Numpy-discussion mailing list