I've started the process to migrate other of my public projects (petsc4py) from the SWIG way to the Cython way. An again, as happened with mpi4py, this was easy, fast, and the final result is far, far, better.
But in this case I have a problem. I need Cython let me hook in the calls to 'tp_visit' and 'tp_clear' supporting garbage collection. In short, I want to be able to add some special method to my objects, and then Cython will always generate gc support (regardeless if my cdef class has or do not have python attributes). In the generated tp_visit and tp_clear, Cython work as current, visiting/clearing python attributes, but near the end of these function, it calll the user-defined special method. Whould such an addition be accepted? Any suggestion on how to name such special methods? Perhaps the obvious ones: __visit__ and __clear__ ? Or perhaps better, __gc_visit__ and __gc_clear__ ?? -- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
