adapter pattern class clientobject()def __init__(selfwhat_i_want)self what_i_want what_i_want def do_something()self what_i_want required_function(if __name__ ="__main__"adaptee whatihave(adapter myadapter(adapteeclient clientobject(adapterclient do_something(adapters occur at all levels of complexity in pythonthe concept of adapters extends beyond classes and their instances oftencallables are adapted via decoratorsclosuresand functools there is yet another way that you could adapt one interface to anotherand this one is even more pythonic at its core object adapter pattern instead of using inheritance to wrap classwe could make use of composition an adapter could then contain the class it wraps and make calls to the instance of the wrapped object this approach further reduces the implementation complexity class objectadapter(interfacesuperclass)def __init__(selfwhat_i_have)self what_i_have what_i_have def required_function(self)return self what_i_have provided_function_ (def __getattr__(selfattr)everything else is handled by the wrapped object return getattr(self what_i_haveattrour adapter now only inherits from interfacesuperclass and takes an instance as parameter in its constructor the instance is then stored in self what_i_have