18.4.4 检查实例
检查实例的方法与检查其他对象相同。
import inspect
from pprint import pprint
import example
a = example.A(name='inspect_getmembers')
pprint(inspect.getmembers(a,inspect.ismethod))
谓词ismethod()找出示例实例中A的两个绑定方法。
18.4.4 检查实例
检查实例的方法与检查其他对象相同。
import inspect
from pprint import pprint
import example
a = example.A(name='inspect_getmembers')
pprint(inspect.getmembers(a,inspect.ismethod))
谓词ismethod()找出示例实例中A的两个绑定方法。