[Pyrex] cdef'd classes initialization
Lenard Lindstrom
len-l at telus.net
Wed Aug 9 15:49:59 UTC 2006
On 9 Aug 2006 at 17:21, Greg Ewing wrote:
>
> I'm thinking about these issues, but I haven't
> figured out what to do about them yet. With new-style
> types, creating an object is complicated enough that
> attempting to bypass the normal mechanisms is fraught
> with peril...
>
The tp_alloc slot function returns a valid object except for user
defined fields, which are zeroed memory. PyType_GenericNew() makes
the call without doing anything else. So this should be what is
wanted. The problem with Pyrex are C methods. So what is needed is
some kind of extension type specific allocation operation that calls
tp_alloc and sets the vtable field, if any.
Lenard Lindstrom
<len-l at telus.net>
More information about the Pyrex
mailing list