ANNOUNCE: 'goto' for Python

Alan James Salmoni alan_salmoni at yahoo.com
Sun Apr 4 18:45:35 EDT 2004


Wow! Thanks very much! Just what I've been looking for.

Umm, would it be possible to discuss a few other possibilities, like
in-line assembly language, GOSUB's, PEEK's, POKE's and file operations
only possible through direct access to the hard disk? I reckon with
these in place, we could out-obfuscate any Perl code in no time! ;^)

Oh damn, it's April 4th - jokes on me... =:/

Alan James Salmoni

Richie Hindle <richie at entrian.com> wrote in message news:<mailman.210.1080803438.20120.python-list at python.org>...
> Entrian Solutions is pleased to announce version 1.0 of the 'goto' module.
> 
> This adds the 'goto' and 'comefrom' keywords to Python 2.3, adding
> flexibility to Python's control flow mechanisms and allowing Python
> programmers to use many common control flow idioms that were previously
> denied to them.
> 
> 'goto' example: breaking out from a deeply nested loop:
> 
>     from goto import goto, label
>     for i in range(1, 10):
>         for j in range(1, 20):
>             for k in range(1, 30):
>                 print i, j, k
>                 if k == 3:
>                     goto .end
>     label .end
>     print "Finished\n"
> 
> 
> 'comefrom' example: letting cleanup code take control after an error.
> 
>     from goto import comefrom, label
>     def bigFunction():
>         setUp()
>         if not doFirstTask():
>             label .failed
>         if not doSecondTask():
>             label .failed
>         if not doThirdTask():
>             label .failed
>     
>         comefrom .failed
>         cleanUp()
> 
> Computed 'goto's are also supported - see the documentation for details.
> Computed 'comefrom's are planned for a future release.
> 
> Documentation and further examples:
>     http://entrian.com/goto/index.html
> 
> Downloads:
>     http://entrian.com/goto/download.html
> 
> The 'goto' module is released under the Python Software Foundation
> license, and requires Python 2.3 or later.
> 
> Please note that this version does not work at the interactive Python
> prompt - code importing 'goto' must be in a .py file.  This restriction
> will hopefully be lifted in a future release.



More information about the Python-list mailing list