Eighty wrote: > I suggest a new extension of the list comprehension syntax: > > [x for x in xs while cond(x)] > > which would be equivalent to > > list(itertools.takewhile(cond, xs)) >
What would this syntax offer that: [x for x in takewhile(cond, xs)] doesn't currently offer? (Apart, that is, from saving you 3 characters of typing) -- http://mail.python.org/mailman/listinfo/python-list