Consider the following:
class objectTest():
def __init__(self, a):
self.value = a
def get_value(self):
return self.value
class exec
Functions and methods in Python are also objects themselves. Thus you can compare them just as you would any other object.
>>> type(a.get_value)
>>> type(a.get_value())
Normally of course you wouldn't compare methods to each other or anything else, because it's not terribly useful. One place it's useful is when you want to pass a function into another function.