On 06:46 am, tjre...@udel.edu wrote:
On 12/13/2009 10:29 PM, exar...@twistedmatrix.com wrote:
Doesn't matter. Sometimes it makes sense to call it directly.

It only makes sense to call next (or .__next__) when you are prepared to explicitly catch StopIteration within a try..except construct.
You did not catch it, so it stopped execution.

Let me repeat: StopIteration is intended only for stopping iteration. Outside that use, it is a normal exception with no special meaning.

You cut out the part of my message where I wrote that one might have forgotten the exception handling code that you posit is required, and that the current behavior makes debugging this situation unnecessarily challenging.

Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to