[issue19318] break more than once

2013-10-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the usual ways to handle the double-break problem are: * check a flag variable in the outer loop * put the outer loop and inner loop in a function so that a return-statement can be used to exit both loops * enclose the outer-loop in a try/except, the

[issue19318] break more than once

2013-10-20 Thread Antoine Pitrou
Antoine Pitrou added the comment: Language ideas such as this are best discussed on the python-ideas mailing-list: https://mail.python.org/mailman/listinfo/python-ideas (note that IMO this particular one has very little chance to succeed :-)) -- nosy: +pitrou resolution: -> postponed s

[issue19318] break more than once

2013-10-20 Thread James Lu
James Lu added the comment: Oh, yes,yes,yes! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue19318] break more than once

2013-10-20 Thread Arfrever Frehtes Taifersar Arahesis
Arfrever Frehtes Taifersar Arahesis added the comment: 'continue' also should support this feature. -- nosy: +Arfrever ___ Python tracker ___

[issue19318] break more than once

2013-10-20 Thread Mark Lawrence
Mark Lawrence added the comment: I suggest that there is a zero chance of this being actioned unless the OP wants to do all of the work and attach all of the required patches to this issue. -- nosy: +BreamoreBoy ___ Python tracker

[issue19318] break more than once

2013-10-20 Thread James Lu
James Lu added the comment: Every new feature takes on new challenges and harder ways to debug. But what about using that very confusing code that I showed that only let's you break one amount, that would be harder to debug! -- ___ Python tracker

[issue19318] break more than once

2013-10-20 Thread James Lu
James Lu added the comment: Big example: pygame, event proccessing loop running. the user clicks "Quit", you do break 2. psuedocode: while True: for event in pygame.events.get(): if event.type==pygame.QUIT: break 2 james On Sun, Oct 20, 2013 at 2:36 PM, Martin Matusiak w

[issue19318] break more than once

2013-10-20 Thread Martin Matusiak
Martin Matusiak added the comment: I see one potential problem with this, namely that refactoring code that contains "break n" statements would become more error prone whenever the depth of the code block gets modified. So if you had something like: for i in range(10): for j in range(10):

[issue19318] break more than once

2013-10-20 Thread James Lu
James Lu added the comment: You would have to do this: for i in range(1,10): broke = True for x in range(2,5): break else: broke = False if broke: break to break twice, and you can't break only once! -- ___ Pyth

[issue19318] break more than once

2013-10-20 Thread Martin Matusiak
Changes by Martin Matusiak : -- nosy: +numerodix ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue19318] break more than once

2013-10-20 Thread James Lu
New submission from James Lu: break 2 would break out of one loop then break out of another. break break would just break once and not execute the second break. break 2 when there are only 1 thing to break would raise raise a SyntaxError: Can only break 1 time, need to break 2 times. --