[Pyrex] Does __Pyx_ImportType need to check struct sizes? (Cython-relevant, too)
Robert Bradshaw
robertwb at math.washington.edu
Sat May 30 17:55:44 CEST 2009
On May 25, 2009, at 5:29 PM, Greg Ewing wrote:
> Robert Bradshaw wrote:
>
>> Perhaps the check should be even stronger, similar to the check we
>> do for public c api methods.
>
> What do you propose the check should do? Remember
> that the type concerned may not have been defined
> in Pyrex or Cython, so adding any extra info to the
> type object won't work in general.
Maybe a list of the struct members (as a char*). Or even a hash of
the attributes and all cdef methods. Most of the time the struct size
is good enough though (but it doesn't catch stuff like re-ordering
fields or newly inserted cdef methods). This would only apply to
classed defined in .pxd Pyrex/Cython.
- Robert
More information about the Pyrex
mailing list