def adopt_class(klass, obj, *args, **kwds):
    'reclass obj to inherit klass; call __init__ with *args, **kwds'
    classname = '%s_%s' % (klass.__name__, obj.__class__.__name__)
    obj.__class__ = new.classobj(classname,  (klass, obj.__class__), {})
    klass.__init__(obj, *args, **kwds)
reclass obj to inherit klass; call __init__ with *args, **kwds
recipes/Python/81984_Class_Adoption/recipe-81984.py