Python的3個方法:靜態方法(staticmethod),類方法(classmethod)和實例方法 【轉】

Python的方法主要有3個,即靜態方法(staticmethod),類方法(classmethod)和實例方法,以下:html 1python 2函數 3spa 4code 5htm 6blog 7ci 8get 9table 10 11 12 13 14 15 16 def foo(x):     print "executing foo(%s)"%(x)    class A(object)
相關文章
相關標籤/搜索