Python で関数を動的に呼び出し、次のようなコードが必要です。
class A:
def show1(self, x) :
print x
def show2(self, x, y) :
print x, y
def callfunc(self, f, args) :
#TODO: call function f with args
pass
c = A()
c.callfunc(c.show1, [1])
c.callfunc(c.show2, [1,2])
しかし、callfunc で "show1" または "show2" を呼び出す方法がわかりません。「show1」と「show2」は引数の数が異なり、「args」はリストであるためです。