Robert Bradshaw, 13.03.2010 21:07:
> On Mar 13, 2010, at 5:30 AM, Stefan Behnel wrote:
>> b) compatibility with Py3 code (->  .py files + "-3" option or
>> "cython3")
>> [...]
>> with the obvious gray area of future imports between a)/c) and b).
>>
>> We don't currently care about the file extension, for example.
>> Should we generally stop supporting the 'cdef' keyword in .py files?

I disabled all Cython specific keywords when compiling .py files.

http://hg.cython.org/cython-devel/rev/198e42d128dd


> The -3 option would be completely orthogonal to the file extension,
> and could be used with both .py and .pyx files.

Actually, I'd even prefer having it a top-level compiler directive instead 
of a command line switch. If a source file is written in Py3 syntax, 
there's no use in making it optional to compile it as Py2 code and vice 
versa. So putting

     # cython: python3=True

at the top is a lot safer and simpler. Maybe we could even be smart and 
pick up a shebang line like

     #!...python3

as Python 3.x installs its interpreter as 'python3' by default, but I guess 
that's hard to do reliably.

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

Reply via email to