>>> On 29 April 2012 01:33, Ian Bell wrote:
>>>> idiom like
>>>>
>>>> if cython.compiled:
>>>>     cython.import('from libc.math cimport sin')
>>>> else:
>>>>     from math import sin

Actually, in this particular case, I would even accept a solution that
special cases the "math" module internally by automatically cimporting
libc.math as an override (or rather an adapted version as plain "math.pxd").

This CEP describes a general approach:

http://wiki.cython.org/enhancements/overlaypythonmodules

It's partly outdated, so things may have become easier these days.

Stefan
_______________________________________________
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel

Reply via email to