chain of responsibility pattern note that this time we do not have any digits in the requestand as result the code for the instance of function class is not executed before the request is passed on to the instance of function class alsonote that we had no change in the code for the setup of the execution chain or in main_function this chain of handlers is the essence of the chain of responsibility pattern  more pythonic implementation in the classic implementation of this patternyou would define some sort of generic handler type that would define the concept of the next_to_execute object as well as the execute function as we have seen beforethe duck-typing system in python frees us from having to add the extra overhead as long as we define the relevant parts for each handler we want to use in the chainwe do not need to inherit from some shared base this not only saves lot of time otherwise spent writing boilerplate codebut also enables youthe developerto easily evolve these types of ideas as your application or system calls for it in more constrained languagesyou do not have the luxury of evolving the design on the fly changing direction like this often requires large redesignwith lot of code requiring rewrite to avoid the pain of redesigning the whole system or rebuilding large parts of the applicationengineers and developers try to cater to every eventuality they can dream up this approach is flawed in two critical ways firsthuman knowledge of the future is imperfectso even if you were to design the perfect system for today ( near impossibility)it would be impossible to account for every way in which clients might use your systemor for where the market might drive your application the second is thatfor the most partyou ain' gonna need it (yagni)orstated differentlymost of the potential futures that get covered in the design of such system will never be neededand as such it is time and effort that has gone to waste once againpython provides the capability to start with simple solution to simple problem and then grow the solution as the use cases change and evolve python moves with youchanging and growing as you do much like the game of gopython is easy to pick upbut you can devote lifetime to mastering its many possibilities