[Pyrex] Opaque structures and Extension Types

Roberto Cavada cavada at fbk.eu
Thu May 15 09:24:22 CEST 2008


Greg Ewing wrote:

> I think you'll just have to initialise the struct in
> __init__ rather than __cinit__, 

Documentation states that:
"""Under some circumstances it is possible for __init__ to be called 
more than once or not to be called at all, so your other methods 
should be designed to be robust in such situations."""

Now if I need to use __init__ I wonder what those 'some 
circumstances' are exactly, especially which are the cases when 
__init__ is not called at all.

For deallocation, I've thought I can rely on __dealloc__ in root 
classes and exploit virtual destructors in my C structures.

Thanks to all!
r.



More information about the Pyrex mailing list