[Python-ideas] Break multiple loop levels

Chris Angelico rosuav at gmail.com
Sat May 11 23:36:23 EDT 2019


On Sun, May 12, 2019 at 1:30 PM David Mertz <mertz at gnosis.cx> wrote:
>
> I'll try to find a concrete one tomorrow. I did this recently, but I might have factored it away somehow. The real life code has lots of extraneous parts that need to be removed or simplified though. Both because they aren't FLOSS, and because the details would muddy things. "Trimmed from real" won't look much different than "invented from scratch".
>
> And yes, OF COURSE everything CAN be rewritten. But that's true in regards to *every* proposed addition. The sentinel break_outer variable is often the was to do it without really big restructuring (but with a handful of ugly bookkeeping lines instead).
>

Yes - that's exactly the sort of thing that makes a great example.
Show the way you'd LIKE to write it, and then show how you have to
write it using current tools. If the latter is really ugly, requires
finicky bookkeeping, or is error-prone, it's a good argument in favour
of the new feature.

ChrisA


More information about the Python-ideas mailing list