Greg Ewing wrote:
> Stefan Behnel wrote:
>
>> Greg Ewing wrote:
>>
>>>If the semantics of strings in the module are fixed when
>>>the source is Cython-compiled, then you end up with a
>>>module which can only be used in one environment
>>
>> This is proven wrong by the current implementation in Cython.
>
> So what happens when you compile your module so that
> "foo" is a unicode string, and then use it in 2.x in
> some situation where it chokes on unicode?

Simple: don't write broken code. If you want a byte string, use a byte
string. Or use a unicode string and encode it before you use it as byte
string. Using a unicode string where a byte string is required is like
passing the string "1" where the number 1 is required. I don't think you'd
want Pyrex to convert between those two either.

If you really think the current implementation has a problem, please
provide a code example.

Stefan

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

Reply via email to