Chain of responsibility pattern in Python
Decoupling complex decision chains.
Chain of responsibility is a behavioural design pattern. It is used to process command objects, where different types of command objects might need to be processed in different ways.
It does this by allowing for multiple handler objects, each capable of handling a specific type of command and rejecting other commands. The command…