Python屬性函數property

說明 Python中的property被稱爲屬性函數,它能夠將類方法轉換爲只讀屬性,從新實現一個屬性的setter和getter方法python 將類方法準換成只讀屬性 正常狀況下使用裝飾器形式@property使用 如:git class Test(object): def __init__(self, a, b): """Constructor"""
相關文章
相關標籤/搜索