On Fri, Dec 4, 2020 at 12:25 AM Jonathan Fine <[email protected]> wrote:
>
> Hi Jonatan
>
> Please consider
> for a in aaa:
> for b in bbb:
> if condition(a, b):
> break
> KEYWORD:
> break
> where KEYWORD is like else, but with the opposite semantics. I think this
> does exactly what you asked for, in your example.
>
well... uhhh.... Technically you can do that already....
for a in aaa:
for b in bbb:
if condition(a, b):
break
else:
continue # We didn't break from b, so continue a
break # We did break b, so break a
But I don't think anyone's actually doing that :)
ChrisA
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/DV2G3OVLINZTXAOHF5WSD5BE2T5VNZIP/
Code of Conduct: http://python.org/psf/codeofconduct/