python中類方法,靜態方法和實例方法的做用和區別

class A(object): # 構造函數 def __init__(self, title1): self.title = title1 print(self.title) # 實例函數 def foo(self, title2): print(title2) # 靜態函數 @staticme
相關文章
相關標籤/搜索