呼び出された関数のデータを別の関数にデリゲートするのは簡単です。
def test2(a, b):
huh = locals()
print huh
def test(a, b='hoho'):
test2(**locals())
ただし、メソッドが呼び出されたときにlocals()
含まれておりself
、メソッド呼び出しのために単一の行で同じことをしようとすると、これが邪魔になります。
class X(object):
def test2(self, a, b):
huh = locals()
print huh
def test(self, a, b='hoho'):
self.test2(**locals()) # no workie
test2(**locals()) # no workie either