15.04.18 19:52, Tim Peters пише:
No, I don't ;-)  If I have to catch StopIteration myself now, then I
want the entire "white True:" loop in the "try" block.  Setting up
try/except machinery anew on each iteration would add significant
overhead; doing it just once per derived generator wouldn't.

This overhead is around 10% of the time for calling `next(it)`. It may be less than 1-2% of the whole step of mytee iteration.

I have ideas about implementing zero-overhead try/except, but I have doubts that it is worth. The benefit seems too small.

Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to