On Wed, 8 Jul 2009 10:54:09 -0400
ma <mabdelka...@gmail.com> wrote:
> filter(lambda x: x, your_list)

Or...

 [x for x in your_list if x]

I'm not sure which one is more efficient but I like the syntax of the
latter.  A smart person could probably figure it out even without
knowing Python syntax.  Clarity is trump.

-- 
D'Arcy J.M. Cain <da...@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to