Em Seg, 2006-03-27 às 18:43 -0800, James Stroud escreveu:
> Here is a suggestion
> 
> todo = {(int, long):abc, (str,):afg, (tuple, list):ijk}
> todo[type(key)]()

Maybe...

todo = {(int, long): abc, basestr: afg, (tuple, list): ijk}
(y for x,y in todo.iteritems() if isinstance(key, x)).next()()

Forget it! Damn, that's too unpythonic! (or perlish =)

-- 
Felipe.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to