Hello everybody !

I sent an email about this some time ago, but it got no answer and I'm still
thinking about it.... It may have been sent during holydays :-)

I was wondering whether we already had (of if it would be interesting to
define) some nice alias to use Cython through Sage. I was wishing for a
one-liner to import a method defined in a .c file or in a library..

What about something like that :

from "file.c" import "function"

such a command would cpdef the function "function" defined inside of file.c,
so that it can immediately be used through Sage, or if we are dealing with a
library (and hence can not guess the function's signature -- but tell me if
I am wrong), something like :

from "file.c" import "int function(int, float, double)"

Each time, it would just amount to wrap the method in a cpdef that can be
called through Python... And it would mean that we can almost use C files
like Python modules (of course, for as long as the types they take as
argument can be obtained from Python types).

I was just trying to compare the performances of the same function written
in Python, Cython, or imported from a C file with such a cpdef... And found
it weird that I had to create a .pyx file to use a function defined in a C
file :-)

Thank youuuuuuuuuuuu !!

Nathann

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to