Popular recipes by Richard Wall http://code.activestate.com/recipes/users/113564/2001-06-12T18:44:04-07:00ActiveState Code RecipesDictionary of Methods/Functions (Python)
2001-06-12T18:44:04-07:00Richard Wallhttp://code.activestate.com/recipes/users/113564/http://code.activestate.com/recipes/65126-dictionary-of-methodsfunctions/
<p style="color: grey">
Python
recipe 65126
by <a href="/recipes/users/113564/">Richard Wall</a>
.
</p>
<p>Construct a dictionary with String (or other) keys and unbound methods or functions as values. During execution, use the string keys to select which method or function to execute. Can be used for simple parsing of tokens from a file thru a kind of object-oriented case statement.</p>