PEP on breaking outer loops with StopIteration

Kris Kowal kris at cixar.com
Tue Jun 10 01:21:37 EDT 2008


On Mon, Jun 9, 2008 at 7:39 PM, Paul Hankin <paul.hankin at gmail.com> wrote:

> Have you checked out http://www.python.org/dev/peps/pep-3136/
>
> It contains exactly this idea, but using 'break letters' rather than
> 'raise letters.StopIteration()'. I think I like the PEP's syntax
> better than yours, but anyway, it was rejected.

I concur that "break letters" is better than "raise
letters.StopIteration()".  Perhaps the novelty of the implementation
idea (adding another exception case to the "while: try" that
must already be there, and the specialized exception type) can wake this
dead issue.  Maybe "break letters" could under the hood raise the
specialized StopIteration.

But, then again.  Guido has said, "No", already on other, albeit
subjective, grounds.
I'll drop it or champion it if there's interest.

Kris Kowal



More information about the Python-list mailing list