[Tutor] stopping a loop

Daniel Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 6 May 2001 03:23:09 -0700 (PDT)


On Sun, 6 May 2001, Praveen Pathiyil wrote:

>         I had one doubt while seeing the discussion about "stopping a loop".
>         Don't we have a "goto" statement in python ?


There is no goto.


However, it appears that the exception-handling model in Python can be
abused toward a similar effect:

    http://www.python.org/doc/FAQ.html#6.26

It's arguable if the idea of a goto is really "evil", but it does
complicate matters enough that it's not a feature in Python.


For amusement, here's a link to Edsgar Dijkstra's famous paper, "Goto's
Considered Harmful":

    http://www.acm.org/classics/oct95/

It's quite short, and pretty nice to see that something written in 1968
still has staying power.