标签: python object methods dynamic
动态调用某个对象方法的更好方法是什么:
method = getattr(object, name) method(*args, **kw)
或者
import operator method = operator.methodcaller(name) method(object, *args, **kw)