Well, at this point I'm a bit confused... The unicode stuff is the weakest point in my knowledge of Python internals...
Anyway, I will not be able to work on this in the next two weeks, so if anyone wants to go on and give a try, just start applying the patch to 'cython-devel-py3' repo (I'm not concerned at all about credits for the original patch ;-) ) in order this does not stagnate. At any point, I can contribute testing against my project, just ask me for help. Finally, IMHO Cython pyx-level and generated C-level code should work with any Python version. So, if in a pyx file I wrote "abc", then, by default, it should be a ascii string for Py2 and a unicode one for Py3. And Cython should grow a new special 'char' type (like it has for bint) to specify ascii string. Then, at the C-level, and depending on Python major version, the proper conversion py->c or c->py can be managed. If not, wrapping legacy C libs and targeting Py2 and Py3 is going to be a nightmare. On 5/9/08, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi, > > > Stefan Behnel wrote: > > For current Cython code, this should just work unchanged - assuming you > import > > the string compatibility header file that #defines PyString_* as PyBytes_*. > > > sorry for the confusion: there is no special header involved. The current API > in Py3.0a5 uses these names: > > bytearray -> PyBytes_* > bytes -> PyString_* > str -> PyUnicode_* > > Described here > > http://www.python.org/dev/peps/pep-3137/ > > with a summary here: > > http://www.python.org/dev/peps/pep-3137/#summary > > We should eventually special case bytearray(b'') literals, although that is > not strictly required. It's more important to actually support these types > and > the coercion between them first. ;) > > > Stefan > _______________________________________________ > Cython-dev mailing list > [email protected] > http://codespeak.net/mailman/listinfo/cython-dev > -- 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
