On May 17, 2008, at 12:28 PM, Stefan Behnel wrote: > Hi, > > Robert Bradshaw wrote: >>> cdef char* s = _some_c_call() >>> result = s + "abc" >> >> This would still work using Py2 semantics (unicode -> str is fine as >> long as it's ascii). > > But it would not work in Py3. And I'm very much against porting Py2 > quirks to > Cython, just because "it worked in Py2".
It is already there, and we're not going to disable it for Py2 code. >>> There's no "automatic" way to heal this. People *will* have to >>> invest work to >>> port their code. >> >> We can mitigate the pain. If someone writes a module in Cython for >> Py2, and then someone wants to use it from Py3, they should just be >> able to compile the C source file (not require the original author to >> do something special in their Cython source). > > Sure, the original author is required to make the source ready for > Py3 either > way. It's very unlikely that this will work out of the box if the > author > relied on Py2 semantics of byte strings and unicode strings. My point is that if they're not required to do anything to be ready for Py3, why force them to do so? If I want to use someone else's (Py2) module in Py3, I should be able to just compile their C file. I think it is extremely likely that it will just work out of the box-- Py3 is not that incompatible. - Robert _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
