I don't understand what value the dictionary is providing here, I suspect none?
How is this better than just functions in a module? (import the module as math_exprs, use getattr)
How is this better than just functions in a module? (import the module as math_exprs, use getattr)
I don’t mean to poo poo on it. I really do like learning new patterns, but I haven’t yet grasped this one’s utility.
You can also list the registered function with math_exprs.keys() and that might not be as easy with a module either.
I don't think it makes much sense in the example code given