I have a class Person and a static method in that class called call_person:
class Person:
def call_person():
print \"he
In python 3.x, you can declare a static method as following:
class Person:
def call_person():
print "hello person"
but the method with first parameter as self will be treated as a class method:
def call_person(self):
print "hello person"
In python 2.x, you must use a @staticmethod before the static method:
class Person:
@staticmethod
def call_person():
print "hello person"
and you can also declare static method as:
class Person:
@staticmethod
def call_person(self):
print "hello person"