Hi, Here is a brief example on how to use expy to implement the math module: (for more details, see http://expy.sf.net/)
"""Python math module by expy-cxpy.""" from expy import * expymodule(__name__) #includes, defines, etc. @prologue def myprolog(): return """ #include <math.h> """ @function(double) #return type: double def sqrt(x=double): #argument x: double """sqrt(x) --> the square root of x.""" return "sqrt(x)" #as an expression #a more terse way @function(double) def sin(x=double): """sin(x) --> the sin of x.""" pass #the deduced call: sin(x) #more functions ... expymodule(__name__) #end of module _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com