Using a context manager for using a file is considered better form than opening the file and closing it manually. In general, it is not too common to see `.close()` on file objects in idiomatic Python code, because files are automatically closed when the file object is garbage collected. If you do want to close a file manually (and it's usually a good idea), it's better to use a context manager.

Consider the following pattern:
```python
foo = open('somefile')
foo.write(generate_html())
foo.close()
```
If the call to `foo.write()` or `generate_html()` raise exceptions, then the `close()` method is not invoked, making the closing of the file unpredictable (it will still be closed when the file object is garbage collected, but it's unclear when that happens). Using a context manager makes the time that the file is closed predictable, even when an exception is raised.