I'm brand new to Cython. Have barely made it through the basic tutorial, so go easy on me. :-)I have an existing Python code base. I know I can use pyximport and tell it to try and Cythonize everything it encounters. That would seem to give only modest performance boost in the common case, as my Python code won't have any type declarations. Can I copy foo.py to foo.pyx and start annotating it, safe in the realization that pyximport will grab the pyx version first? Or do I need to delete the py version?
Thx,Skip Montanaro
Renaming files, removing .pyc files, etc seems counterintuitive. If
your .py and .pyx files can't have the same base name and .pyx can't
take precedence over .pyc, how would
pyximport.install(pyimport=True)
ever work? (It doesn't work for me, at least at the moment, but that's
a different story, I think.)
Thx,
Skip
I suppose we could change the precedence and put foo.pyx right next to foo.so at
http://stackoverflow.com/questions/6319379/python-shared-object-module-naming-convention
though generally I think it's preferable to handle this decision in
your setup.py file rather than using pyximport at runtime.
Nope. I use the term "package" here in a much-broader-than-Pythonsense. If, for example, our system didn't have a valgrind package, I
could build it from source and package it up.
Recent PyPI offerings installed this way
include statsmodels, patsy, pylint, scikit, and Theano.