[Mumps2Py:] [129] using *args for the arguments is a bit cleaner.

[ Thread Index | Date Index | More lists.mumps2py.org/discuss Archives ]


Revision: 129
Author:   pgallot
Date:     2008-02-24 23:58:41 +0000 (Sun, 24 Feb 2008)

Log Message:
-----------
using *args for the arguments is a bit cleaner.

Modified Paths:
--------------
    trunk/mumps2py/mumpsCL.py
    trunk/mumps2py/tok2python.py


Modified: trunk/mumps2py/mumpsCL.py
===================================================================
--- trunk/mumps2py/mumpsCL.py	2008-02-24 23:56:50 UTC (rev 128)
+++ trunk/mumps2py/mumpsCL.py	2008-02-24 23:58:41 UTC (rev 129)
@@ -172,9 +172,9 @@
                 next_index = varkeys[nextnode]
     return next_index
     
-def Mf_select(testlist):
+def Mf_select(*args):
     """Python-equivalent of the Mumps $Select intrinsic"""
-    for testcase, value in testlist:
+    for testcase, value in args:
         if testcase:
             return value
     return False

Modified: trunk/mumps2py/tok2python.py
===================================================================
--- trunk/mumps2py/tok2python.py	2008-02-24 23:56:50 UTC (rev 128)
+++ trunk/mumps2py/tok2python.py	2008-02-24 23:58:41 UTC (rev 129)
@@ -372,7 +372,7 @@
         """ translates the Mumps Intrinsic function SELECT to Python"""
         assert((len(token.params) % 2) != 1)
         translation.add_cl_import()
-        select_str = "Mf_select(("
+        select_str = "Mf_select("
         while token.params:
             testcase = token.params.pop(0)
             testvalue = token.params.pop(0)
@@ -381,7 +381,7 @@
                           translate_expr(translation, testcase),
                           translate_expr(translation, testvalue))
 
-        select_str = select_str + "))"
+        select_str = select_str + ")"
         return select_str
 
 


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/