From 1cf07b943fab4511ef619e1710a9addaf2573e72 Mon Sep 17 00:00:00 2001 From: Victor Lei Date: Tue, 16 Aug 2016 10:05:37 +0300 Subject: [PATCH] fixed nargin --- smop/backend.py | 6 +++--- smop/core.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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):