On Wed, Oct 28, 2009 at 11:26 AM, Stefan Behnel <[email protected]> wrote: > Robert Bradshaw, 28.10.2009 10:45: >> >> http://trac.cython.org/cython_trac/ticket/439 > > Mark, thanks a lot for doing that. I hope you copied the wchar_t adaptation > part from somewhere, looks like a lot of work otherwise. > > [snip] > > Another thing I noticed is the use of PyMem_Malloc() and friends. I'm not > sure if it's safe to use those before initialising the Python interpreter. > Anyway, I think that plain malloc() and free() make more sense here.
I copied this almost verbatim from Python 3.1.1's Modules/python.c. I assume using PyMem is fine since CPython does it, but I default to your judgment... > One thing that strikes me, however, is the amount of code duplication. I > think we should put cython_freeze into the Cython package (e.g. as > Cython/Compiler/MainFunction.py), so that the compiler can use it to > generate a main() function, and just add a __main__ execution body at the > end that runs from the command line. Distutils could still install the > module as a "cython_freeze" script in /usr/bin then, and the shipped > bin/cython_freeze would simply import and run > Cython/Compiler/MainFunction.py (so that you don't need to install Cython > to get a runnable script). Yes, I agree entirely. Once this gets tested and finalized, I think it would be great to merge cython_freeze into Cython as you suggest. Unfortunately, I don't know how to proceed... :) -- Mark _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
