Lisandro Dalcin, 25.08.2010 21:57: > On 25 August 2010 16:16, Stefan Behnel wrote: >> Lisandro Dalcin, 25.08.2010 21:00: >>> $ cython -3 tmp.pyx >>> >>> Error converting Pyrex file to C: >>> ------------------------------------------------------------ >>> ... >>> cdef str a = "abc" >>> ^ >>> ------------------------------------------------------------ >>> >>> /u/dalcinl/tmp/tmp.pyx:1:13: Cannot convert Unicode string to 'str' >>> implicitly. This is not portable and requires explicit encoding. >> >> Same thing I said before: if you request unicode string literals, you get >> unicode literals. > > But in Python 3, the the Python-level 'str' type actually is an unicode > string!
Ah, right, I missed that. Yes, I think it makes sense to statically associate 'str' with 'unicode' on -3. BTW, note that '-3' is mostly meant for people who really want to write code that also runs in plain Python 3, i.e. for pure mode. Having it work on .pyx files is IMHO a nice feature that allows users to write their Cython code with the simpler Py3 syntax and semantics, but I doubt that it will be interesting for existing code, so the above can't currently break anything. It should get fixed for 0.13.1, though. Stefan _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
