[Pyrex] cdef'd classes initialization

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Aug 12 01:28:08 UTC 2006


Daniele Varrazzo wrote:
> In the patched source, each class doesn't call its 
> superclass to receive an object, but instead it creates one using 
> tp_alloc, sets its own vtable and then calls the __new__ methods in the 
> proper order.

This isn't always possible, however -- one of the
base classes might be a non-Pyrex class, in which
case Pyrex doesn't have access to a separated-out
version of the initialisation code.

And if I introduce a way of making the base
initialisation call explicit, so that you can
control the arguments, it mightn't be possible
to separate them in Pyrex so easily either.

However, there are other ways of getting the same
effect, such as only setting the vtable pointer if
it hasn't already been set by a base class.

I will continue to think about it. Thanks for the
suggestions.

--
Greg



More information about the Pyrex mailing list