An alternative way of doing what you need that doesn't add any syntax, is more readable, runs faster, scales better and has long been used as the reason that python doesn't need a case statement would be:
# Dictionary of which actions to take for foo foo_action_dict = { 'a':a, 'b':b, 'c':c, } def foo_default_handler(): """ Handler for remaining cases of foo """ print("Input value must be one of", foo_action_dict.keys())
# Call the appropriate action for foo: action_dict.get(foo, foo_default_handler)()
[Steve Barnes]