On Sun, Feb 3, 2013 at 12:50 AM, Serhiy Storchaka email@example.com wrote:
On 02.02.13 15:01, Chris Angelico wrote:
I think the utility function iterwith() is a good - and probably the best - method; it demands nothing special from the language, and works quite happily.
When should iterwith() call __exit__()?
According to the OP's posted code, as soon as the iterable runs out. Not sure what happens if you don't exhaust it but I'm sure generator functions have already solved that, too.