class Scriptable:

    def __init__(self, script=None):
        if script is not None:
            self.script = types.MethodType(script, self)

def script(self):
    print('greetings from the default script')
Assigning a function to an object attribute