Chris Angelico wrote:
On Fri, Jun 17, 2011 at 9:29 AM, Erik Max Francis <m...@alcyone.com> wrote:
Chris Angelico wrote:
On Fri, Jun 17, 2011 at 8:07 AM, Erik Max Francis <m...@alcyone.com> wrote:
It's quite consistent on which control structures you can break out of --
it's the looping ones.
Plus functions.
No:

def f():
...  break
...
 File "<stdin>", line 2
SyntaxError: 'break' outside loop

Yes:
def f():
    return
    print("Won't happen")

"break out of" doesn't necessarily require the break keyword per se.
You can abort a function part way, same as you can abort a loop part
way.

Look back at the context.  I was actually talking about the break keyword.

--
Erik Max Francis && m...@alcyone.com && http://www.alcyone.com/max/
 San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
  Human salvation lies in the hands of the creatively maladjusted.
   -- Dr. Martin Luther King, Jr.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to