About Dynamically Assigned Object Methods

In Python you can bind a method to an object dynamically like this:

class TheClass(object):
    pass

def unbound_method(self, text):
    print(text)

obj = TheClass()
obj.method = unbound_method.__get__(obj, TheClass)
obj.method("Hello")

Tips and Tricks Programming Python 3