On 5/22/08, Greg Ewing <[EMAIL PROTECTED]> wrote: > Stefan Behnel wrote: > > This would normally call for two special functions __getbuffer__ and > > __releasebuffer__. To me, however, this looks like an extremely C-ish > > interface that does not fit Cython at all. > > > That's because it's designed for use by C code, not by > Python code. Trying to make it more "Python-like" would > defeat the purpose of having it in the first place.
As I reviewed in the past the whole PEP and even suggested modification to Travis that went in, I believe that I have a rough idea of the beast. I believe Stefan's proposal is a high-level, wrapper API more convenient for writting Cython code, but as capable as the native C one. The only point were I'm not sure is about hidding the 'internal' field. Appart ot that, it seems to me that Stefan is going in the right direction. However, Iff I do not missinterpreted Greg's comments, Stefan's proposal has a problem: iff the new PyxBuffer is goint to be a full featured, true type object, then that is going to impose runtime overheads. Travis designed the interface that way in order to avoid any kind of Python object allocations. So perhaps the __getbuffer__ should still receive a pointer to Py_buffer or a pure C-struct wrapper around it in order to fill the buffer data. Perhaps we should disturb Travis and consult him about this. -- 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
