Working around a lack of 'goto' in python
Roy Smith
roy at panix.com
Tue Mar 9 12:25:50 EST 2004
In article <slrnc4rs8k.ks3.joe at gate.notcharles.ca>,
Joe Mason <joe at notcharles.ca> wrote:
> In article <c718a6cf.0403090836.564f690b at posting.google.com>, Y2KYZFR1 wrote:
> >> > Step away from the computer slowly . . .
> >> >
> >> > There is absolutely NO LEGITIMATE REASON to use GOTO in any modern
> >> > language, ESPECIALLY Python, EVER!
> >> >
> >> > No stay away from computers until you understand how and why this is.
> >>
> >>
> >> Bull. I've used goto's in similar cases as those presented. I have
> >> found that in the right cases they are quite readable. Never had a
> >> problem with them when used like this.
> >>
> >> So you didn't answer the question, how would you do this clearly in
> >> Python?
> >>
> >
> > same way you would do it in any other OBJECT ORIENTED language. Use
> > the appropriate pattern.
>
> Which would be what? (No, it's not exceptions. Stay away from this
> thread until you understand why it's not.)
>
> Joe
OK, I'll bite. What's wrong with exceptions for breaking out of deeply
nested loops?
More information about the Python-list
mailing list