Smith, Jeff wrote:
> I find a common thing to do is
> 
> l = list()
> for i in some-iterator:
>     if somefum(i) != list:
>       l.append(somefun(i))

How about using the same condition you do in the if? Like:
l=[somefun(i) for i in some-iterator if not type(somefun(i)) is list]

HTH
Jordan
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to