<div dir="ltr"><div class="gmail_quote">On Fri, May 13, 2011 at 8:28 PM, Amaury Forgeot d'Arc <span dir="ltr"><<a href="mailto:amauryfa@gmail.com">amauryfa@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
2011/5/13 cool-RR <<a href="mailto:cool-rr@cool-rr.com">cool-rr@cool-rr.com</a>>:<br>
<div><div></div><div class="h5">> Hey,<br>
> Here's something I thought about that might be a compatibility problem, not<br>
> sure if it's a problem in production. When you take a method of a builtin in<br>
> Pypy, for example `str.join`, it seems to create a new object which is<br>
> weakreffable, where in CPython it's not. I was just looking at Django's<br>
> signal mechanism:<br>
> <a href="http://docs.djangoproject.com/en/1.3/topics/signals/#listening-to-signals" target="_blank">http://docs.djangoproject.com/en/1.3/topics/signals/#listening-to-signals</a><br>
> It creates a weak reference to the signal-handler function, and if it dies,<br>
> the link is destroyed.<br>
> Do you think this might be a problem?<br>
<br>
</div></div>But why would you use an unbound method of a builtin type<br>
as a signal handler?<br>
<br>
Note that "sender" is passed as first argument to the function,<br>
whereas i.e. str.join expected a string.<br>
<br>
--<br>
<font color="#888888">Amaury Forgeot d'Arc<br>
</font></blockquote></div><br>In the case of Django signal handlers it would probably not be a problem in practice, but in other systems it might become a problem so if it can be fixed early (e.g. by making `list.__add__ is list.__add__` True in Pypy as it is in CPython) it might save us some trouble later.<br>
<div><br></div><div><br></div><div>Ram.</div></div>