If you have a fixed and small number of cases, the if-elif-else
approach is the fastest (and I can't see why it would be un-Pythonic); for a sufficiently large number of cases, a dict
lookup will be better.
If the set of cases is dynamic, the dict
approach is of course the only viable one.
Also, a third, non-orthodox approach, would be to use macro metaprogramming. This is not possible with vanilla python, however there are libraries e.g. https://github.com/lihaoyi/macropy that allow you to do this in an (arguably) clean manner (most probably not approved by the Python community or Guido).
P.S. on second thought, the macro approach probably wouldn't work in Python as it would in Lisp in the case of most macro implementations for Python, which try to stick to the syntax of vanilla Python; i.e. generating an if-elif-else
block from within a macro wouldn't be possible.