学习笔记(19):Python 面试100讲(基于Python3.x)-请解释@classmethod 和 @staticmethod 的用法和区别...

立即学习:https://edu.csdn.net/course/play/26755/340163?utm_source=blogtoedu staticmethod和classmethod相同点: 使用@staticmethod或@classmethod装饰类方法。调用该类方法时就可以不需要实例化类,直接使用“类名称.方法名()”来调用即可。这两个都是类级别的方法,不是类实例级别的。   st
相关文章
相关标签/搜索