A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/attachments/20120526/8cc8fa71/attachment.html below:

<div class="gmail_quote">On 26 May 2012 03:46, Antoine Pitrou <span dir="ltr">&lt;<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Fri, 25 May 2012 10:21:39 -0700<br>
Ethan Furman &lt;<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>&gt; wrote:<br>
&gt; I&#39;d like to make a slight doc change for weakref to state (more or less):<br>
&gt;<br>
&gt; Â  Â  weakrefs are not invalidated when the strong refs<br>
&gt; Â  Â  are gone, but rather when garbage collection<br>
&gt; Â  Â  reclaims the object<br>
&gt;<br>
&gt; Should this be accurate for all implementations, or should it be more<br>
&gt; along the lines of:<br>
&gt;<br>
&gt; Â  Â  weakrefs may be invalidated as soon as the strong refs<br>
&gt; Â  Â  are gone, but may last until garbage collection reclaims<br>
&gt; Â  Â  the object<br>
<br>
</div>How about: weakrefs are invalidated when the object is destroyed,<br>
either as a product of all the strong references being gone or the<br>
object being reclaimed by the :term:`cyclic garbage collector<br>
&lt;garbage collection&gt;`.<br></blockquote><div><br></div><div>I think this could be misleading - it could be read as weakrefs are gone as soon as all strong refs are gone if there are no cycles. It&#39;s CPython-specific.</div>
<div><br></div><div>IIRC this was exactly Ethan&#39;s issue on python-list - he&#39;d made the assumption that weakrefs went away as soon as all strong refs were gone, which broke on other Python implementations (and would have also broken if he&#39;d had cycles).</div>
<div><br></div><div>How about: weakrefs are invalidated only when the object is destroyed,</div><div>which is dependent on the garbage collection method implemented.</div><div><br></div><div>That then prevents an implementation from invalidating weakrefs before GC - however, since the object would then be completely unreachable (except by C code) I&#39;m not sure it matters.</div>
<div><br></div><div>Tim Delaney</div></div>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4