Yes this can be acheived by using staticmethod decorator
class MyClass(object):
@staticmethod def the_static_method(x):
print x MyClass.the_static_method(2)
# outputs 2
Note:- Code might use the old method of defining a static method, using staticmethod as a function rather than a decorator.
class MyClass(object):
def the_static_method(x):
print x the_static_method = staticmethod(the_static_method)
MyClass.the_static_method(2)
# outputs 2
This is entirely identical to the first example (using @staticmethod), just not using the nice decorator syntax.