Catch-all proposal based on proxies

Brendan Eich brendan at
Thu Dec 10 13:30:55 PST 2009

On Dec 10, 2009, at 12:56 PM, Mike Samuel wrote:

>> Generators compose in some ways though the syntax can be awkward:
>> def zip(a, b):
>>  for a_el in a:
>>    yield (a_el,
>>  try:
>>  except StopIteration:
>>    pass
>>  except:
>>    raise AssertionError('%r not exhausted', b)
> Sorry, zip should probably just read
>  def zip(a, b):
>    for a_el in a:
>      yield (a_el,

Right -- it really is quite rare to have to catch StopIteration. If  
you feel the need, something else may be going on that needs  
addressing at a higher level.


More information about the es-discuss mailing list