Robert Bradshaw wrote:
> On Mar 13, 2010, at 11:10 PM, Stefan Behnel wrote:
> 
>> Robert Bradshaw, 13.03.2010 21:07:
>>> On Mar 13, 2010, at 5:30 AM, Stefan Behnel wrote:
>>>> a) compatibility with Py2 code (->  when compiling .py files)
>>>> b) compatibility with Py3 code (->  .py files + "-3" option or
>>>> "cython3")
>>>> c) the Cython language (->  .pyx files)
>>>>
>>>> We don't currently care about the file extension, for example.
>>>> Should we generally stop supporting the 'cdef' keyword in .py files?
>>> The only place that the extension currently matters is that with  
>>> a .py
>>> file, signatures and other declarations don't have to match what they
>>> are in the .pxd file (the ones from the .pxd file get pulled over).
>>> This may result in compile time errors, when renaming a .py file to
>>> a .pyx file, which I'm OK with, but we should definitely avoid any
>>> behavioral changes due to changing the file extension.
>> The only reason why a user would choose the .py extension is because  
>> the
>> code should work also in plain CPython, i.e. purely pure mode. So,  
>> what I
>> meant was: when compiling a .py file, we should keep Cython specific  
>> syntax
>> (especially keywords) out of the way, so that Cython can compile as  
>> much
>> Python code as possible.
> 
> Ah, yes, it would be good to support
> 
> cdef = 4
> 
> in a .py file.

Perhaps the easiest thing here (once we start on this, which IMO is past 
1.0) could be to switch to using the Python parser for .py files and 
transform the resulting tree to a Cython tree. Rather than litter 
Parsing.py with special cases.

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

Reply via email to