Comment Comment by codefisher The equivalent code with out the context manager is actually this: f = open('foo.txt') try: contents = f.read() finally: f.close() So yes, extra reason to prefer the context manager. parent codefisher 11 years ago