[Numpy-discussion] PyArray_DescrConverter - alignment / trailing unused bytes

Travis Oliphant oliphant.travis at ieee.org
Fri Sep 15 13:05:50 CDT 2006


Martin Wiechert wrote:
> Hi list,
>
> I'm using PyArray_DescrConverter with a dict object to create a "struct-like" 
> dtype from C.
> As the struct contains different data types I run into "unaligned access" 
> problems.
> Is there a way to force alignment or to get trailing unused bytes in the 
> dtpye?
>   
Besides calling the tp_new function (or the method __new__),  I added 
PyArray_DescrAlignConverter to the C-API.

It is at the end and so does not require re-compilation of extension 
modules (unless you want to use it...)

-Travis





More information about the Numpy-discussion mailing list