In Python, at least, this pattern is called the "dispatch dictionary" and relies on the ability of Python to store just about anything as dictionary values. It is considered to be Python's answer to the question, "Why is there no switch/case in Python?"
Comments
In Python, at least, this pattern is called the "dispatch dictionary" and relies on the ability of Python to store just about anything as dictionary values. It is considered to be Python's answer to the question, "Why is there no switch/case in Python?"