ContextDecorator via contextmanager: broken?

2011-06-10 Thread Ian Kelly
Python 3.2 has this lovely new contextlib.ContextDecorator mixin [1] for context manager classes that allows you to apply the context manager as a decorator. The docs for this feature include the note: ContextDecorator is used by contextmanager(), so you get this functionality automatically.

Re: ContextDecorator via contextmanager: broken?

2011-06-10 Thread Ian Kelly
On Fri, Jun 10, 2011 at 4:57 PM, Ian Kelly ian.g.ke...@gmail.com wrote: So as far as I can tell, generator-based context managers simply can't be used as ContextDecorators.  Furthermore, the documentation's claim that they can is actually harmful, since they *appear* to work at first.  Or am I