Dec 12, 2021
Function objects are very useful, but I am not sure the example you gave would be classed as clean code.
You are essentially implementing the chain of responsibility design pattern, but instead of using separate classes for each case you are using a list of dictionaries that are all required to have identical keys (but with no compile time check that they are correct).
I am not sure it is any cleaner or safer than the chained if-else statements.