what is the the best way to express following:

AndyL ask at me
Mon Mar 27 20:54:25 EST 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