[Python-Dev] PEP 3003 - Python Language Moratorium

Stefan Behnel stefan_ml at behnel.de
Thu Nov 5 11:47:46 CET 2009


Michael Foord, 05.11.2009 11:18:
> Stefan Behnel wrote:
>> We certainly aim for Python compatibility. That's a proclaimed 1.0 goal.
> 
> Right, but I think the main point is that Cython is not an
> implementation of Python. It uses Python syntax, calling into the Python
> runtime for many of its features

It is a Python implementation in the sense that it implements syntax and
semantics of the Python language, be it through generated C code or by
calling into the CPython runtime. You could theoretically drop the entire
interpreter from CPython, and Cython would still work with the remaining
parts - not that it would be worth the effort on either side...


>  and *extending* Python syntax for compilation to C.

Programmers can decide themselves if they want to statically type
variables, and they can do so without breaking with Python syntax. It is
certainly not required to use non-Python syntax to compile Python code, not
even if you want to get a fast binary module as a result.


> Obviously a grey area - but if you take Cython code and try to run it on
> ClassicPython then you are likely to have syntax errors. The same is not
> true of the other full implementations (although where they use native
> platform features you may not have the same libraries available - but
> the language is unchanged).

To me, the term "Python implementation" just means something that
implements the Python language. That shouldn't prevent it from providing
additional features. Jython can interface with Java code, IronPython can
interface with .NET code, Cython can interface with C code. Not sure what
PyPy allows in addition to being a Python implementation, but there surely
are language features also in PyPy that no other Python implementation
provides.

Stefan



More information about the Python-Dev mailing list