Stefan Behnel wrote: > Dan Stromberg, 14.12.2009 17:27: >> Stefan Behnel wrote: >>> I assume you know that Cython can compile .py files and has a pure Python >>> syntax for type declarations? >>> >>> http://wiki.cython.org/pure >>> >> Actually, I didn't know that. It's interesting, but I don't think it's >> what I want; I'm looking for something that will allow my code to not >> depend on cython at all in one form. > > Your code /won't/ depend on Cython, that's what this is all about. All you > need is a tiny cython.py file in your distribution that implements a dummy > 'cython' module (we actually ship that). That's all you add as a > "dependency" to your otherwise normal Python code. It will run in the > normal Python interpreter, although it will run faster if you use Cython to > compile it.
Be advised however that a) there's quite a few features not available in pure Python mode, and b) one has to be a bit careful because sometimes when writing code in pure Python mode, it could mean one thing in Python and another in Cython, as the semantics are not closely enough lined up (yet). As long as one know what one is doing and knows Cython pretty well, it's pretty good though. Another approach that was mentioned here some time ago was a script that would take Cython code (well, a subset) and transform it into pure Python code. I don't remember the final outcome though. -- Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
