<div dir="ltr"><div class="gmail_quote">On Fri, May 13, 2011 at 8:28 PM, Amaury Forgeot d&#39;Arc <span dir="ltr">&lt;<a href="mailto:amauryfa@gmail.com">amauryfa@gmail.com</a>&gt;</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 &lt;<a href="mailto:cool-rr@cool-rr.com">cool-rr@cool-rr.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Hey,<br>
&gt; Here&#39;s something I thought about that might be a compatibility problem, not<br>
&gt; sure if it&#39;s a problem in production. When you take a method of a builtin in<br>
&gt; Pypy, for example `str.join`, it seems to create a new object which is<br>
&gt; weakreffable, where in CPython it&#39;s not. I was just looking at Django&#39;s<br>
&gt; signal mechanism:<br>
&gt; <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>
&gt; It creates a weak reference to the signal-handler function, and if it dies,<br>
&gt; the link is destroyed.<br>
&gt; 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 &quot;sender&quot; 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&#39;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>