[IPython-dev] 'Unwrapping' decorated functions in IPython

Thomas Kluyver takowl at gmail.com
Fri Jul 15 10:22:33 EDT 2011


On 15 July 2011 14:57, Michele Simionato <michele.simionato at gmail.com>wrote:

> in practice I think this cannot happen accidentally, but only if ones
> builds a contrived example
> like the following:
>

My concern is that if some bizarre object's __getattr__ method falls back on
returning an object of the same type as itself, and there isn't an actual
__wrapped__ attribute, we end up going round in circles. Of course, it's
easy enough to Ctrl-C out of it, but it's not ideal.

Maybe an unwrapping limit as you suggest is the best way forwards. If the
limit is something like 100, it should get to the bottom of any set of
decorators, but still seem instant if something recurses.

Thanks,
Thomas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20110715/fa4a187b/attachment.html>


More information about the IPython-dev mailing list