装饰的功能@staticmethod和装饰的功能有什么区别@classmethod?
是否有在静态方法中引用自己的类的简写?
说我有这段代码:
class SuperLongClassName(object):
@staticmethod
def sayHi():
print 'Hi'
@staticmethod
def speak():
SuperLongClassName.sayHi() # Is there a shorthand?
Run Code Online (Sandbox Code Playgroud)