Since everything is an object in Python (even functions) is it possible to actually extend from function class? For example I can do the following with string type. Is there any way to do something similar on function type?
class Foo(str):
def appendFoo(self):
return self+'foo'
foo = Foo('test')
print foo
>>> test
print foo.upper()
>>> TEST
print foo.appendFoo()
>>> testfoo