On 27/04/2012 5:57 a.m., Kiuhnm wrote:
On 4/26/2012 19:48, Paul Rubin wrote:
Roy Smith<r...@panix.com> writes:
x = [a for a in iterable while a]

from itertools import takewhile

x = takewhile(bool, a)

I see that as a 'temporary' solution, otherwise we wouldn't need 'if'
inside of list comprehensions either.

Kiuhnm

We have if inside list comprehensions? I didn't know that, could you provide an example?
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to