Josh Rosenberg added the comment:

I don't think you understand how wrapping works. At the time you're enumerating 
the stack, the wrapped function has not actually been called. Only the wrapper 
has been called. If the stack included "junk" when junk had not yet been 
executed, the stack would be a lie.

>From the interpreter's point of view, it doesn't even know that wrapping is in 
>play, aside from the chain of __wrapped__ values attached to the wrapper by 
>functools.wraps (as a convenience). Until you actually call the wrapped 
>function, it's possible you could change your mind and call some other 
>function instead; Python won't stop you, and Python can't tell the difference 
>before the call has been made.

----------
nosy: +josh.rosenberg

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue21794>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to