On May 30, 2008, at 4:24 AM, Stefan Behnel wrote:

> Hi Robert,
>
> I'm currently fixing up your latest changes ("import *" etc.). You  
> have to be
> a bit careful now with identifiers (including imported names). They  
> are no
> longer byte strings in Py3, so calling PyString_AsString() on them  
> will not
> work (besides the function not being available in Py3 anymore :)

Good point.

>
> Also, code like
>
>                 code.putln('"%s",' % name)
>
> may not work in all cases. If we can't be sure it's a pure ASCII  
> identifier
> (i.e. it was parsed as an identifier by the current Cython parser),  
> the name
> has to be encoded as UTF-8 first and escaped using  
> Utils.escape_byte_string().

On this note, what happens when a cdef variable (like above) has non- 
ASCII characters in it?

> I think this was ok in your source, so I'm just mentioning it in  
> general. I'll
> try to write up a short howto in the Wiki when I get to it (unless  
> someone
> else wants to start it first ...)

Yes, that'd be good. I knew there was some unicode stuff I might have  
to worry about here, but wasn't sure what at that point.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to