On 2012-01-11, joha...@gmail.com <joha...@gmail.com> wrote: > That suggests that I cannot rely on the > contextlib.contextmanager decorator to ensure that the > connection is closed and would have to write my own object with > __enter__ and __exit__ methods to guarantee this.
contextmanager wraps your generator in an object with __enter__ and __exit__ methods for you. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list