summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-08-20 22:07:07 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-08-20 22:07:07 (GMT)
commit9439f04b9af6d31d8ff6fb5601d32d004946e9cc (patch)
treebaba3c67026cb25dcb7aad7f8fc753f122eedb3d
parentc6fdafcdf39ce01f7b3fa3eeb8bf297a2905d3b3 (diff)
downloadcpython-9439f04b9af6d31d8ff6fb5601d32d004946e9cc.zip
cpython-9439f04b9af6d31d8ff6fb5601d32d004946e9cc.tar.gz
cpython-9439f04b9af6d31d8ff6fb5601d32d004946e9cc.tar.bz2
Issue #14954: Clarify the interaction of weak references and garbage collection.
Patch by Ethan Furman.
-rw-r--r--Doc/library/weakref.rst5
-rw-r--r--Misc/ACKS1
2 files changed, 5 insertions, 1 deletions
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst
index 2ad1e56..224f442 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -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.
diff --git a/Misc/ACKS b/Misc/ACKS
index 30505cd..7f22360 100644
--- 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