python中反射4种方法的基本使用

class Foo(object): def __init__(self): self.name = "laozhang" def func(self): return "hello python" obj = Foo() #判断obj中是否有第二个参数 #若是第二个只是属性,则返回属性值,若是是方法名,则返回方法的内存地址,若是第二个参数没有
相关文章
相关标签/搜索