On Friday, February 7, 2014 11:49:12 AM UTC+2, Stephen J. Turnbull wrote:
Steven D'Aprano writes:

 > iter(func, "NOBODY expects the Spanish Inquisition!!!")

+1 Code Snippet of the Week!

A++, would run again :)

Now back to serious discussion: I do prefer a separate keyword argument rather than reusing `sentinel`. If `sentinel_exception` is too verbose, then an alternative is `exception`, but just not `stop_iter` which is very undescriptive.

Also, I'd support having three separate implementations for the `iter` function, one for just sentinel, one for exception, and one for both, so the iteration would be as quick as possible after the iterator was created.


Thanks,
Ram.