what is the the best way to express following:

AndyL ask at me
Tue Mar 28 03:54:25 CEST 2006


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 ...



More information about the Python-list mailing list