AndyL wrote:
> 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 ...

No, I hit send too soon, mixing ideas in my head. Paul McGuire's answer 
is the way to go.

James

-- 
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to