标签:
转自Stackoverflow
@classmethod means: when this method is called, we pass the class as the first argument instead of the instance of that class (as we normally do with methods). This means you can use the class and its properties inside that method rather than a particular instance.
@staticmethod means: when this method is called, we don‘t pass an instance of the class to it (as we normally do with methods). This means you can put a function inside a class but you can‘t access the instance of that class (this is useful when your method does not use the instance).
Python @classmethod&@staticmethod 区别
标签:
原文地址:http://www.cnblogs.com/yaoshi/p/5076413.html