On Tue, Nov 24, 2009 at 6:41 PM, Stefan Behnel <[email protected]> wrote: > > Lisandro Dalcin, 24.11.2009 22:18: >> On Tue, Nov 24, 2009 at 5:32 PM, Stefan Behnel <[email protected]> wrote: >>> Joachim Saul, 24.11.2009 20:59: >>>> cdef extern from "Python.h": >>>> ctypedef class __builtin__.str [object PyStringObject]: >>>> pass >>> Remove the above and use the 'bytes' type in the rest of your code instead. >>> 'str', 'unicode' and 'bytes' are builtin types in Cython. >> >> Anyway, any good reason for such code to fail in Cython? Should we >> support such declarations of builtin types? I think Cython should be >> able to compile as much Pyrex code as possible. > > Well, supporting this would mean that we'd have to check the above > declaration, including the header file name and all potentially declared > type fields. >
As usual, I was not clear enough. I was thinking about just ignoring the declaration, no check at all, and perhaps generate a warning. My whole point is on providing some sort of compatibility with Pyrex. Anyway, this is not a big deal for me. > > Forbidding it is a lot easier, I think. > OK. I understand your point. I'm not going to spend my time on this, nor I'm asking Cython-devs to do so. But If at some point a third party generates a patch proposing to maintain as much compatibility as possible between Cython and Pyrex, I think it should devise some consideration. -- 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
