GoTo considered missing

David LeBlanc whisper at oz.net
Tue Jul 2 23:55:13 EDT 2002


> -----Original Message-----
> From: python-list-admin at python.org
> [mailto:python-list-admin at python.org]On Behalf Of Harvey Frey
> Sent: Tuesday, July 02, 2002 17:54
> To: python list
> Subject: GoTo considered missing
>
>
>     OK. I'm a spaghetti-coder from way back, new to Python.
> I didn't even realize there was no "goto" till I tried to rewrite a big C
> program in Python.
>
>     Breaks and Continues are fine for single loops, but:
> What is the approved Python method for getting from the bottom of a set of
> nested loops to the top?

Return works well. So would an exception. However, if you're writing python
code that uses nested loops like that, it's possible you're not taking good
advantage of Python's features.

>     Maybe I could rewrite the big loop with function calls, but I'd be
> knee-deep in recursion.

Care to share what you're working on? It might be that you're using "basic
think" and not considering Python's advanced features.

> Harvey
> =========================
> Harvey S. Frey MD PhD Esq.
> hsfrey at harp.org  www.harp.org
> C'est Vrai. C'est Frey!
> =========================

Dave LeBlanc
Seattle, WA USA






More information about the Python-list mailing list