Re: Does __Pyx_ImportType need to check struct sizes? (Cython-relevant, too)
Robert Bradshaw <[email protected]> Wed, 3 Jun 2009 01:56:31 -0700
| Newsgroups | gmane.comp.python.pyrex |
|---|---|
| Message-ID | <[email protected]> |
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