GNU Info

Info Node: (python2.1-ref.info)break statement

(python2.1-ref.info)break statement


Next: continue statement Prev: raise statement Up: Simple statements
Enter node , (file) or (file)node

The `break' statement
=====================

     break_stmt:     "break"

`break' may only occur syntactically nested in a `for' or `while' loop,
but not nested in a function or class definition within that loop.

It terminates the nearest enclosing loop, skipping the optional `else'
clause if the loop has one.

If a `for' loop is terminated by `break', the loop control target keeps
its current value.

When `break' passes control out of a `try' statement with a `finally'
clause, that `finally' clause is executed before really leaving the
loop.


automatically generated by info2www version 1.2.2.9