
On Wed, Aug 10, 2011 at 2:47 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
Guido van Rossum <guido@python.org> writes:
It seems that your problem is how to get to the function object underneath the stack of decorators given an object that is the fully-decorated function. Never mind then.
Yes. I'd still like a solution to that.
The thing is that there isn't a general purpose way to resolve that question. Consider a wrapper like functools.lru_cache. It has 3 downcalls to other functions: tuple, sorted and the decorated user function. Without an explicit convention (like the __wrapped__ convention adopted by functools in 3.2), there's no way for external code to follow the chain downwards. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia