question on namedtuple

2010-04-01 Thread hetchkay
Hi, For purposes I don't want to go into here, I have the following code: def handleObj(obj): if isinstance(obj, MyType): return obj.handle() elif isinstance(obj, (list, tuple, set)): return obj.__class__(map (handleObj, obj)) elif isinstance(obj, dict): return

Re: question on namedtuple

2010-04-01 Thread Chris Rebert
On Thu, Apr 1, 2010 at 11:35 AM, hetchkay hetch...@gmail.com wrote: Hi, For purposes I don't want to go into here, I have the following code: def handleObj(obj):  if isinstance(obj, MyType):     return obj.handle()  elif isinstance(obj, (list, tuple, set)):     return obj.__class__(map

Re: question on namedtuple

2010-04-01 Thread Peter Otten
hetchkay wrote: For purposes I don't want to go into here, I have the following code: def handleObj(obj): if isinstance(obj, MyType): return obj.handle() elif isinstance(obj, (list, tuple, set)): return obj.__class__(map (handleObj, obj)) elif isinstance(obj, dict):