ANNOUNCE: 'goto' for Python

Gonçalo Rodrigues op73418 at mail.telepac.pt
Thu Apr 1 08:17:29 EST 2004


On Thu, 01 Apr 2004 08:10:29 +0100, Richie Hindle <richie at entrian.com>
wrote:

>
>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.


Thanks a lot!! Now I at least have a chance to shame my perlite
friends in obfuscation contests with a suitably spaghetified Python
code. I'm getting all warm and fuzzy with the possibilities this
module opens.

Once again, thanks a lot for your efforts to improve the Python
language, with my best regards,
G. Rodrigues



More information about the Python-list mailing list