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

class Foo(object): def __init__(self): self.name = "laozhang" def func(self): return "hello python" obj = Foo() #判斷obj中是否有第二個參數 #若是第二個只是屬性,則返回屬性值,若是是方法名,則返回方法的內存地址,若是第二個參數沒有
相關文章
相關標籤/搜索