On Sun, May 12, 2019 at 1:16 PM David Mertz <[email protected]> wrote:
>
> Ok, sure. But what if different seen_enough() conditions are in the two inner 
> loops? By "break to outer" ... I mean, don't get any more 'main' from 
> 'stuff'. I meant to dig through some real code, but forgot because I was 
> writing code for work. This example on my tablet is the general pattern I 
> often need though. And obviously I've solved it one way or another hundreds 
> of times.
>
> I think a "labelled break" would be nice though. It might have even been a 
> past PEP.
>

This is why concrete examples are much easier to discuss, heh.

In any case, it's often possible to either (a) redefine the inner loop
as some sort of container operation, or (b) redefine the outer
operation as a function, and use "return". So it would be helpful to
have an example that CAN'T be rewritten in one of those ways, to use
as a compelling example.

ChrisA
_______________________________________________
Python-ideas mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to