On Mon, Sep 15, 2014 at 5:15 PM, ISE Development <isen...@gmail.com> wrote:
> The first two lines are as expected, using the name of the decorated
> function. However, the exception uses the name of the decorating wrapper
> function.
>
> Is this a bug in functools? Or is this a language feature? If so, is there a
> valid argument to change this behaviour?

I believe this is done in order to have useful stack traces. If it
said 'method' in the stack trace, it could mislead the person
debugging into thinking that method is actually raising the exception,
but here the exception is actually coming from wrapped, and method is
not even called.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to