Message132471
Here I worked out a patch to make the function decorated by context manager returned by @contextmanager reusable, by storing original function object and argments(args, kwds objects) in _GeneratorContextManager and construct a generator when needed(in self.__enter__ while used as a context manager and self.__call__ while used as a decorator). It still inherit ContextDecorator to keep class inheritation complete and the __call__ method is override. |
|
Date |
User |
Action |
Args |
2011-03-29 08:33:34 | ysj.ray | set | recipients:
+ ysj.ray, ncoghlan, pitrou, michael.foord |
2011-03-29 08:33:34 | ysj.ray | set | messageid: <1301387614.67.0.317302109133.issue11647@psf.upfronthosting.co.za> |
2011-03-29 08:33:33 | ysj.ray | link | issue11647 messages |
2011-03-29 08:33:33 | ysj.ray | create | |
|