def foobar():
    print('FOOBAR!')

def foobaz():
    print('FooBAZ!')


class SampleClass:

    def foo(self):
        foobar()

def printfunc(self):
    self.foo()


class DerivedClass(SampleClass):

    def foo(self):
        foobaz()
sample = SampleClass()
sample.printfunc()
derived = DerivedClass()
derived.printfunc()
Call Python object's variable as a function without passing the calling object