On Apr 21, 2008, at 2:18 PM, Stefan Behnel wrote:

> Hi,
>
> Robert Bradshaw wrote:
>> Whether it
>> makes it easier to make the entire parser operate on unicode I don't
>> know (would there be a performance impact?)
>
> Not much of an impact, there is so much happening in between that  
> you won't
> notice the encoding/decoding steps. At least in Py2.5, byte strings  
> and
> unicode strings are similarly fast.

Good, that's what I was hoping.

>> As for making docstrings unicode in Python 2, I think this is a bad
>> idea because some programs extract and manipulate them at runtime and
>> will be expecting Strings.
>
> I'd rather think that any tool that does not know how to deal with  
> unicode
> strings as doc-strings is broken in Py2 already. It's not uncommon  
> to have
> them, it's just not the default.

I won't argue with this, but if I write

def foo(x):
     """some docstring"""

and foo.__doc__ is a unicode object in Py2, we're not conforming to  
the spec.

- Robert


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

Reply via email to