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.

>>> I think we need to do that if we really want to introduce a well
>>> defined notion of "language level compatibility".
>>
>> What I want is that Cython is a superset of Python. In particular,  
>> for
>> widespread use it should be safe (barring bugs) to just compile a .py
>> file and run it. I don't think our "language level compatibility"
>> needs to be more granular than Py2 (meaning specifically 2.6, or  
>> maybe
>> 2.7) and Py3 (meaning 3.1?), at least not right now (there are bigger
>> fish to fry).
>
> Ok, let's assume that most Py3 syntax that we support will make it  
> into
> Py2.7 anyway, so targeting something close to 2.7 should work.


Yes. 2.7 should be a backwards compatible superset of 2.6.

Whichever one we pick I want to be able to say if it runs differently  
(or not at all) in Cython compared to Python 2.(6|7), that's a bug.   
(Likewise, if it runs differently in Cython with the -3 flag compared  
to a choice of Python 3.x, that's a bug.)

- Robert

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

Reply via email to