creating class as an adapter is the usual way to implement this patternbutas usualthere are other ways to do it in python inheritance and multiple inheritance can be used to add functionality to class for examplewe could add an adapter on the date class so that it works with the original agecalculator classimport datetime class ageabledate(datetime date)def split(selfchar)return self yearself monthself day it' code like this that makes one wonder if python should even be legal we have added split method to our subclass that takes single argument (which we ignoreand returns tuple of yearmonthand day this works flawlessly with the original agecalculator class because the code calls strip on specially formatted stringand stripin that casereturns tuple of yearmonthand day the agecalculator code only cares if strip exists and returns acceptable valuesit doesn' care if we really passed in string it really worksbd ageabledate( today ageabledate today(today ageabledate( agecalculator(bda calculate_age(today it works but it' stupid idea in this particular instancesuch an adapter would be hard to maintain we' soon forget why we needed to add strip method to date class the method name is ambiguous that can be the nature of adaptersbut creating an adapter explicitly instead of using inheritance usually clarifies its purpose instead of inheritancewe can sometimes also use monkey-patching to add method to an existing class it won' work with the datetime objectas it doesn' allow attributes to be added at runtimebut in normal classeswe can just add new method that provides the adapted interface that is required by calling code alternativelywe could extend or monkey-patch the agecalculator itself to replace the calculate_age method with something more amenable to our needs finallyit is often possible to use function as an adapterthis doesn' obviously fit the actual design of the adapter patternbut if we recall that functions are essentially objects with __call__ methodit becomes an obvious adapter adaptation