Re: PEP on breaking outer loops with StopIteration

2008-06-10 Thread nwinters3000
On Jun 9, 10:50 pm, Dan Bishop <[EMAIL PROTECTED]> wrote: > On Jun 9, 8:07 pm, "Kris Kowal" <[EMAIL PROTECTED]> wrote: > > > I had a thought that might be pepworthy.  Might we be able to break > > outer loops using an iter-instance specific StopIteration type? > > > You can break out of outer loops

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Diez B. Roggisch
Kris Kowal schrieb: I had a thought that might be pepworthy. Might we be able to break outer loops using an iter-instance specific StopIteration type? This is the desired, if not desirable, syntax:: import string letters = iter(string.lowercase) for letter in letters: for n

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Dan Bishop
On Jun 9, 8:07 pm, "Kris Kowal" <[EMAIL PROTECTED]> wrote: > I had a thought that might be pepworthy.  Might we be able to break > outer loops using an iter-instance specific StopIteration type? > > This is the desired, if not desirable, syntax:: > >     import string >     letters = iter(string.lo

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Luis Zarrabeitia
Quoting Kris Kowal <[EMAIL PROTECTED]>: > I had a thought that might be pepworthy. Might we be able to break > outer loops using an iter-instance specific StopIteration type? > > This is the desired, if not desirable, syntax:: > > import string > letters = iter(string.lowercase) >

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Kris Kowal
On Mon, Jun 9, 2008 at 7:39 PM, Paul Hankin <[EMAIL PROTECTED]> 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, bu

Re: PEP on breaking outer loops with StopIteration

2008-06-09 Thread Paul Hankin
On Jun 10, 10:07 am, "Kris Kowal" <[EMAIL PROTECTED]> wrote: > I had a thought that might be pepworthy.  Might we be able to break > outer loops using an iter-instance specific StopIteration type? > > This is the desired, if not desirable, syntax:: > >     import string >     letters = iter(string.