Peter Otten wrote: > [EMAIL PROTECTED] wrote: > > > However, I found something interesting which I don't quite understand : > > > > list((x for x in [1,2,3] if x<2 or stop())) works > > > > but > > > > a = [ x for x in [1,2,3] if x <2 or stop() ] doesn't. > > Here's how Carl Banks explained it to me when Bengt came up with this > trick. > > http://mail.python.org/pipermail/python-list/2005-April/274051.html > Thanks, but that is even more confusing for me. I thought it is the "for" that trap the StopIteration as in :
for x in iteratables: pass But it said it is not ? -- http://mail.python.org/mailman/listinfo/python-list