2 messages in org.python.python-bugs-list[ python-Feature Requests-846553 ] Ad...
FromSent OnAttachments
SourceForge.netMar 13, 2004 10:25 pm 
SourceForge.netMar 13, 2004 11:24 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[ python-Feature Requests-846553 ] Addition to break and continueActions...
From:SourceForge.net (nore@sourceforge.net)
Date:Mar 13, 2004 10:25:34 pm
List:org.python.python-bugs-list

Feature Requests item #846553, was opened at 2003-11-21 07:48 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=355470&aid=846553&group_id=5470

Category: Python Interpreter Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Alexander R?dseth (alexanro)

Assigned to: Guido van Rossum (gvanrossum)

Summary: Addition to break and continue

Initial Comment: It would be great if one could use "break for", "break while", "continue for" or "continue while".

A silly example:

for i in range(100): counter = 0 while 1+1 == 2: counter += 1 if counter > 5: break for

"break for" should here jump out of the for-loop, as opposed to just "break" that would jump out of just the while loop. Using "break for" and friends will make code a lot more readable and explicit, and avoid using exception throwing and catching, and other acrobatics.

I believe this suggestion is in sync with the Python Design guidelines.

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)

Date: 2004-03-13 16:41

Message: Logged In: YES user_id=80475

Guido, I recommend against accepting these forms which are out of sync with the way the rest of the world uses break, continue, try, and except.

The proposal is also thin on use cases and does not fit comfortably with the current implementation.

----------------------------------------------------------------------

Comment By: Michael Dubner (dubnerm) Date: 2003-11-21 20:43

Message: Logged In: YES user_id=39274

What you will do to exit from outer of two for's from inside inner?

----------------------------------------------------------------------