天天看點

Python中的反射

fun = getattr(str,'__len__') 

print fun('abc') #相當于執行 'abc'.__len__