Python vs Java garbage collection?
Ype Kingma
ykingma at accessforall.nl
Mon Dec 23 04:44:07 EST 2002
More information about the Python-list mailing list
Mon Dec 23 04:44:07 EST 2002
- Previous message (by thread): Python vs Java garbage collection?
- Next message (by thread): Python vs Java garbage collection?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Eric, Thanks, Ype > >> Untested code: >> >> def openread(fname): >> try: >> fp = open(fname) >> return fp.read() >> finally: >> fp.close() > fp = open(fname) > try: > return fp.read() > finally: > fp.close() > > If open throws, then the fp name will not be bound, so on the way out > the finally clause will generate a NameError.
- Previous message (by thread): Python vs Java garbage collection?
- Next message (by thread): Python vs Java garbage collection?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list