[Pyrex] Does __Pyx_ImportType need to check struct sizes? (Cython-relevant, too)

Robert Bradshaw robertwb at math.washington.edu
Wed Jun 3 10:56:31 CEST 2009


On Jun 2, 2009, at 4:53 PM, Greg Ewing wrote:

> Robert Bradshaw wrote:
>> On Jun 1, 2009, at 5:10 PM, Greg Ewing wrote:
>>> How is that going to work for types that weren't
>>> created using Pyrex/Cython?
>> It won't, but do we check for the sizes of those types anyways?
>
> As far as I remember, yes. Pyrex has no way of knowing
> whether a cimported extension type was defined using
> Pyrex or not. It just relies on the C compiler knowing
> the size of the object struct, which it should do in
> either case.
>
> Changing this would require adding some kind of syntax
> for declaring that an extension type is a Pyrex-defined
> one, and it would make non-Pyrex extension types into
> second-class citizens in some respects.

We could just check if the extension type is extern and do different  
behavior based on that, but I think the current system works well  
enough.

- Robert




More information about the Pyrex mailing list