[issue11647] function decorated with a context manager can only be invoked once

Antoine Pitrou report at bugs.python.org
Fri Mar 25 16:24:21 CET 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

> Because there is no *OBVIOUS* code or sign which can illustrate that
> context manager changes from a one-shot to a reusable.

I'm talking about the decorator, not the context manager. Surely there
is a way for the decorator to instantiate a new context manager each
time the decorated function is called? I may miss something, but it
doesn't sound like rocket science.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11647>
_______________________________________


More information about the Python-bugs-list mailing list