class MyClass(object):
def fn():
return 1
for i in [method for method in dir(inspect) if callable(getattr(inspect, method))]:
print i(MyClass) // Error here
错误:TypeError:“str”对象不可调用
如果我将打印语句更改为:
print "%s(MyClass)" % i
这只是打印:
ArgInfo(MyClass)
and so on...