[Python-Dev] Rewrite @contextlib.contextmanager in C (original) (raw)
Chris Angelico rosuav at gmail.com
Tue Aug 9 14:49:41 EDT 2016
- Previous message (by thread): [Python-Dev] Rewrite @contextlib.contextmanager in C
- Next message (by thread): [Python-Dev] Rewrite @contextlib.contextmanager in C
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Aug 10, 2016 at 4:43 AM, Giampaolo Rodola' <g.rodola at gmail.com> wrote:
- return self.class(self.func, self.args, self.kwds) + func, args, kwds = self.funcak + return self.class(func, args, kwds)
return self.class(*self.funcak)
@wraps(func) def helper(*args, **kwds): return GeneratorContextManager(func, args, kwds) + + updatewrapper(helper, func)
Isn't update_wrapper exactly what @wraps is doing for you?
ChrisA
- Previous message (by thread): [Python-Dev] Rewrite @contextlib.contextmanager in C
- Next message (by thread): [Python-Dev] Rewrite @contextlib.contextmanager in C
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]