]> granicus.if.org Git - python/commitdiff
Issue #14954: Clarify the interaction of weak references and garbage collection.
authorAntoine Pitrou <solipsis@pitrou.net>
Mon, 20 Aug 2012 22:07:07 +0000 (00:07 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Mon, 20 Aug 2012 22:07:07 +0000 (00:07 +0200)
Patch by Ethan Furman.

Doc/library/weakref.rst
Misc/ACKS

index 2ad1e566a95dc6ca4fe0cce6b55341d317a5ed22..224f442eddeab3112fb9a66a9b0c1961a1c30f8c 100644 (file)
@@ -24,7 +24,10 @@ by a weak reference.
 A weak reference to an object is not enough to keep the object alive: when the
 only remaining references to a referent are weak references,
 :term:`garbage collection` is free to destroy the referent and reuse its memory
-for something else.  A primary use for weak references is to implement caches or
+for something else.  However, until the object is actually destroyed the weak
+reference may return the object even if there are no strong references to it.
+
+A primary use for weak references is to implement caches or
 mappings holding large objects, where it's desired that a large object not be
 kept alive solely because it appears in a cache or mapping.
 
index 30505cd005892b2c4bb430f97dcc274acdb3eb6f..7f223607a99c91029730d36e5bd61cce56b8bef4 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -317,6 +317,7 @@ Jim Fulton
 Tadayoshi Funaba
 Gyro Funch
 Peter Funk
+Ethan Furman
 Geoff Furnish
 Ulisses Furquim
 Hagen Fürstenau