GOTO (was Re: Appeal for python developers)

Leif K-Brooks eurleif at ecritters.biz
Sat Mar 5 14:55:42 EST 2005


beliavsky at aol.com wrote:
> Goto is useful [...] when there is a clean-up section of a function
> that should be executed for various error conditions.

Like this?

def foo():
     f = open('foo.txt')
     try:
         # do stuff with f
     finally:
         f.close()



More information about the Python-list mailing list