What is the python "with" statement designed for?
- by fmark
I came across the Python with statement for the first time today. I've been using Python lightly for several months and didn't even of its existence! Given its somewhat obscure status, I thought it would be worth asking:
What is the Python with statement
designed to be used for?
What do
you use it for?
Are their any
gotchas I need to be aware of, or
common anti-patterns associated with
its use?