On Tue, May 10, 2016 at 11:48 AM Peter Otten <__pete...@web.de> wrote:

> Steven D'Aprano wrote:
> > I have a decorator that adds an attribute to the decorated function:
> >    inner.instrument = instrument
> >    return inner
>


> the original instrument is still accessible as f.__wrapped__.instrument


I'd say Peter's example is Option 6:
Wrap the instrumented function with a second instrumented wrapper.

Since you have various kinds of instruments, silently adding another layer
makes sense to me. Is it OK if the order matters? Will some of the
instruments get confused because they're working on a wrapper instead of
the original function?
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to