Py:python中@classmethod @staticmethod区别

python中@classmethod @staticmethod区别 Python中3种方式定义类方法, 常规方式, @classmethod修饰方式, @staticmethod修饰方式. 1.定义方式 普通的类方法foo()需要通过self参数隐式的传递当前类对象的实例。 @classmeth
posted @ 2019-08-11 21:28  liyinguo  阅读(581)  评论(0编辑  收藏  举报