class Foo(object):

    def x(self):
        print('y')

def Bar(parent=Foo):


    class Adoptee(parent):

        def __init__(self):
            self.x()
return Adoptee()
obj = Bar(parent=Foo)
Set an object's superclass at __init__?