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"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></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 <<a href="mailto:ethan@stoneleaf.us">ethan@stoneleaf.us</a>> wrote:<br>
> I'd like to make a slight doc change for weakref to state (more or less):<br>
><br>
> Â Â weakrefs are not invalidated when the strong refs<br>
> Â Â are gone, but rather when garbage collection<br>
> Â Â reclaims the object<br>
><br>
> Should this be accurate for all implementations, or should it be more<br>
> along the lines of:<br>
><br>
> Â Â weakrefs may be invalidated as soon as the strong refs<br>
> Â Â are gone, but may last until garbage collection reclaims<br>
> Â Â 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>
<garbage collection>`.<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's CPython-specific.</div>
<div><br></div><div>IIRC this was exactly Ethan's issue on python-list - he'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'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'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