adapter pattern in system where we have only two interfacesthis is not bad solutionbut by now you know that very rarely will it stay just the two systems what also tends to happen is that different parts of your program might make use of the same service suddenlyyou have multiple files that need to be altered to fit every new interface you introduce in the previous you realized that adding to system by creating multipleoften telescopingif statements all over the place is rarely the way to go you want to create piece of code that goes between the library or interface you have and makes it look like the interface you want adding another similar service will then simply entail adding another interface to that serviceand thus your calling object becomes decoupled from the provided service class adapter one way of attacking this problem is to create several interfaces that use polymorphism to inherit both the expected and the provided interfaces sothe target interface can be created as pure interface class in the example that followswe import third-party library that contains class called whatihave this class contains two methodsprovided_function_ and provided_function_ which we use to build the function required by the client object from third_party import whatihave class whatiwantdef required_function(self)pass class myadapter(whatihavewhatiwant)def __init__(selfwhat_i_have)self what_i_have what_i_have def provided_function_ (self)self what_i_have provided_function_ def provided_function_ (self)self what_i_have profided_function_ def required_function(self)self provided_function_ (self provided_function_ (