[Python-ideas] Re: Make for/while loops nameable.

2020-12-04 Thread Abdulla Al Kathiri
Oh I like it. Indexing the loop number from innermost to outermost makes more sense. The starting implicit index in case of alone continue/break will always be known (either 1 or zero). Of course it doesn’t make sense to use negative index for the loop because breaking from the parent loop will

[Python-ideas] Re: Make for/while loops nameable.

2020-12-04 Thread Valentin Berlier
I think this is the kind of feature that can very easily be abused. Whenever I want to break out of a nested loop I take this as an opportunity to extract the loop into its own function and use the return statement to break out of the loop. IMO this is a lot better than having named or indexed l

[Python-ideas] Re: Make for/while loops nameable.

2020-12-04 Thread Aveheuzed
I think this is the kind of feature that can very easily be abused. Whenever I want to break out of a nested loop I take this as an opportunity to extract the loop into its own function and use the return statement to break out of the loop. IMO this is a lot better than having named or indexe

[Python-ideas] Re: Make for/while loops nameable.

2020-12-04 Thread David Mertz
I like the idea of named breaks, but I *hate* the idea of numerically labeled breaks, whether numbered from the inside or from the outside. On the occasions—which are actually relatively frequent—that I want to break all the way out of an inner loop, I wind up using a sentinel STOP variable. I kn

[Python-ideas] Re: Make for/while loops nameable.

2020-12-04 Thread Rob Cliffe via Python-ideas
On 04/12/2020 20:18, David Mertz wrote: I like the idea of named breaks, but I *hate* the idea of numerically labeled breaks, whether numbered from the inside or from the outside. [snip] The problem with numbers, beyond just being harder to count out, is that they are fragile under refactorin