Re: [Python-Dev] Rewrite @contextlib.contextmanager in C

2016年8月09日 12:01:32 -0700

On Wed, Aug 10, 2016 at 4:43 AM, Giampaolo Rodola' <[email protected]> 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)
> +
> + update_wrapper(helper, func)
Isn't update_wrapper exactly what @wraps is doing for you?
ChrisA
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to