[Scipy-svn] r4499 - trunk/scipy/sandbox/mkufunc

scipy-svn@scip... scipy-svn@scip...
Sun Jun 29 05:30:24 CDT 2008


Author: ilan
Date: 2008-06-29 05:30:22 -0500 (Sun, 29 Jun 2008)
New Revision: 4499

Modified:
   trunk/scipy/sandbox/mkufunc/funcutil.py
Log:
Free variables still need work

Modified: trunk/scipy/sandbox/mkufunc/funcutil.py
===================================================================
--- trunk/scipy/sandbox/mkufunc/funcutil.py	2008-06-29 08:53:48 UTC (rev 4498)
+++ trunk/scipy/sandbox/mkufunc/funcutil.py	2008-06-29 10:30:22 UTC (rev 4499)
@@ -25,10 +25,11 @@
     
     acc.write('co_names:\n')
     for name in co.co_names:
-        if name in '''math exp log sqrt
-                      cos sin tan acos asin atan atan2'''.split():
-            continue
-        acc.write('%8s: %s\n' % (name, eval(name)))
+        try:
+            tmp = str(eval(name))
+        except NameError:
+            tmp = 'EVAL_FAILED'
+        acc.write('%8s: %s\n' % (name, tmp))
     
     res = acc.getvalue()
     
@@ -70,7 +71,7 @@
     def f(x):
         return math.sin(x) + math.cos(x)
     md5sums.append(func_hash(f))
-
-    assert md5sums == ['b821514915e98426c49d93f58e400025',
-                       '2bf13d8983c80c8fd773db4534a2c1b6',
-                       '8d2ce5ab9152dabc3d49d0732fb84666']
+    #print md5sums
+    assert md5sums == ['91d13599d610a554dccd6b44cb5ef1f0',
+                       'be0c54b477180f897cbf7604fc565d18',
+                       '732d1ef6c1ce8cc92a7f28917496d292']



More information about the Scipy-svn mailing list