<div class="gmail_quote">On 15 July 2011 14:57, Michele Simionato <span dir="ltr"><<a href="mailto:michele.simionato@gmail.com">michele.simionato@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>in practice I think this cannot happen accidentally, but only if ones builds a contrived example</div>
<div>like the following:</div></blockquote></div><br>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.<br>
<br>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.<br><br>Thanks,<br>
Thomas<br>