Greg Ewing wrote: > Robert Bradshaw wrote: > > >> The issue here is speed. ... Hence a >> special class with a cdef method. >> > > Ah, okay. Although if you're doing this from cython, using > the C callback API directly would be even faster. I suppose > you're just trying to create something a bit more convenient > or type-safe? > Ondrej would have to answer what his exact usecase is, but making sweeping generalizations:
- Scientific Python/Cython programmers need to call C libraries with fast callbacks - Scientific Python/Cython programmers don't know much C (or any C at all, in many cases), the C function pointer notation is frightening, and the C libraries often have APIs which are very low-level and need a higher-level wrapper anyway. So there's quite a demand for nice Cython libraries which are fast callable from Cython and provides a "Python-like" API while being fast. I think you'd be surprised how little C some Cython coders know; and that's also one of Cython's target audiences. Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
