軟體工程師的工作筆記
網頁
C++
首頁
vim
extjs
顯示具有
staticmethod
標籤的文章。
顯示所有文章
顯示具有
staticmethod
標籤的文章。
顯示所有文章
2015年7月6日 星期一
[Python] @staticmethod 和 @classmethod
主題: @staticmethod和@classmethod的差別
說明:
這兩個都是decorator,
一言以蔽之 classmethod的input function第一個參數必須是class,
而staticmethod則第一個參數就是真的參數。
可以參考
這邊
(staticmethod/classmethod)
另外一提,這兩個的實作方式和@property的做法很像。
較舊的文章
首頁
訂閱:
文章 (Atom)