But there is:

```
with open('filename', 'r'): as f:
  do_stuff(f)
```