break in a module

Erik Max Francis max at alcyone.com
Thu Jun 16 19:29:50 EDT 2011


Chris Angelico wrote:
> On Fri, Jun 17, 2011 at 8:07 AM, Erik Max Francis <max at 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

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
  San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Skype erikmaxfrancis
   Do not stand in a place of danger trusting in miracles.
    -- (an Arab proverb)



More information about the Python-list mailing list