Re: Does __Pyx_ImportType need to check struct sizes? (Cython-relevant, too)
Robert Bradshaw <[email protected]> Sat, 30 May 2009 08:55:44 -0700
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
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