John Reese <[EMAIL PROTECTED]> writes: > Consider the function above. Do I need the fp.close(), or will the > file be closed automatically when fp goes out of scope and its > reference count drops to zero?
In CPython, fp gets closed when it leaves scope. In other implementations you may need try-finally. There's been occasional discussion of possible new Python control blocks to make this easier. -- http://mail.python.org/mailman/listinfo/python-list