If your test variable has specific values to branch on, the standard way is to have those values be keys in a dictionary, and do:
branched_func_obj = dict_of_values.get(testvar) And the lambda hack is here, courtesy of Peter Norvig http://www.norvig.com/python-iaq.html -- http://mail.python.org/mailman/listinfo/python-list