[Python-ideas] Break multiple loop levels

Oleg Broytman phd at phdru.name
Sun May 12 05:16:21 EDT 2019


On Sun, May 12, 2019 at 01:36:28AM -0700, Elias Tarhini <eltrhn at gmail.com> wrote:
> If I may propose `break n` as a replacement for the original message's
> `break break ... break`, where n>0 is the number of contiguous loops to
> break out of and `break 1` is synonymous with `break`. Seems easier on my
> eyes/noggin than counting out the individual `break` statements.

   This is very much error-prone because on any refactoring (increasing
or decreasing the number of loop levels) one must increase/decrease all
numbers in internal loops.

   Labels are at least stable.

> Eli

Oleg.
-- 
    Oleg Broytman            https://phdru.name/            phd at phdru.name
           Programmers don't die, they just GOSUB without RETURN.


More information about the Python-ideas mailing list