diff --git a/smop/backend.py b/smop/backend.py index 7eabf95a..25c4883d 100644 --- a/smop/backend.py +++ b/smop/backend.py @@ -223,10 +223,10 @@ def _backend(self,level=0): s = """ @function -def {0}({1}{2}nargin=-1): +def {0}({1}): + nargin = sys._getframe(1).f_locals["nargin"] """.format(self.ident._backend(), - self.args._backend(), - "," if self.args else "") + self.args._backend()) return s diff --git a/smop/core.py b/smop/core.py index baf2eeaa..532cbfc1 100644 --- a/smop/core.py +++ b/smop/core.py @@ -709,9 +709,9 @@ def print_usage(): raise Exception def function(f): - def helper(*args,**kwargs): - kwargs["nargin"]=len(args) - return f(*args,**kwargs) + def helper(*args): + nargin=len(args) + return f(*args) return helper def error(s):