Hi,
one of the goals of Cython is to "compile Python code". I think we should be
clearer here. I would opt for making Python 2.6 the target syntax and
eventually write a separate/enhanced/whatever parser for Python 3.0 syntax and
semantics (unicode/bytes literals, new keywords, etc.).
This has several advantages, the most important one being code compatibilty.
While it will be work to migrate from Py2 to Py3, it shouldn't affect Cython
users and the existing Cython code.
Also, I really like the fact that "test" is a plain byte string in Cython that
can directly be converted to a C char*, depending on its use. This shouldn't
change, even if Py3 dictates that this literal becomes a Unicode string.
Cython positions itself between Python and C, and that's a place where the
plain string literal semantics make perfect sense. Supporting the b"test"
bytes syntax *in addition* is ok with me, as is the u"unicode" syntax, which
Python2 and Cython currently use. I think it makes sense to be explicit about
unicode objects in the context of Cython.
Having a separate Cython frontend (cython3? or a command line option "-3"?)
and a distutils Extension option for compiling Python3 code with Python3
semantics might be a way to deal with the syntax issue. But I would actually
prefer a different source file extension (.cy3) or a special comment in the
first code line, or something like that. The language level is an integral
part of the source file, not so much of the build system. Even
from __future__ import python3
might work. ;)
Any comments on this?
Stefan
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev