StopIteration in the if clause of a generator expression

jfj jfj at freemail.gr
Fri Apr 1 19:26:43 EST 2005


Peter Otten wrote:
> To confuse a newbies and old hands alike, Bengt Richter wrote:

got me for one:)


> 
> To make it a bit clearer, a StopIteration raised in a generator expression
> silently terminates that generator:

*any* exception raised from a generator, terminates the generator


jfj



More information about the Python-list mailing list