Re: Re: list comprehension question
On Fri, 2009-05-01 at 13:00 -0400, John Posner wrote: > Shane Geiger wrote: > >if type(el) == list or type(el) is tuple: > A tiny improvement: > > if type(el) in (list, tuple): > Another alternative, which might be useful in some cases: if hasattr(el, '__iter__'): This co
Re: Re: list comprehension question
Shane Geiger wrote: if type(el) == list or type(el) is tuple: A tiny improvement: if type(el) in (list, tuple): -- http://mail.python.org/mailman/listinfo/python-list