James Stroud wrote: > Here is a suggestion > > todo = {(int, long):abc, (str,):afg, (tuple, list):ijk} > todo[type(key)]() Is not that a shortcut? I have got "KeyError" exception ...