This is annoying:
class MyClass:
@staticmethod
def foo():
print \"hi\"
@staticmethod
def bar():
MyClass.foo()
You can do something hacky by making a module level function foo and then adding it to the class namespace with staticmethod:
def foo():
print "hi"
class MyClass(object):
foo = staticmethod(foo)
@classmethod
def bar(cls):
return cls.foo()
def baz(self):
return foo()
c = MyClass()
c.bar()
c.baz()
MyClass.bar()
MyClass.foo()