[Python-checkins] r84725 - in python/branches/release27-maint: Lib/collections.py Misc/NEWS

raymond.hettinger python-checkins at python.org
Sun Sep 12 04:11:46 CEST 2010


Author: raymond.hettinger
Date: Sun Sep 12 04:11:45 2010
New Revision: 84725

Log:
Issue #9825:  Remove __del__() from OrderedDict.

Modified:
   python/branches/release27-maint/Lib/collections.py
   python/branches/release27-maint/Misc/NEWS

Modified: python/branches/release27-maint/Lib/collections.py
==============================================================================
--- python/branches/release27-maint/Lib/collections.py	(original)
+++ python/branches/release27-maint/Lib/collections.py	Sun Sep 12 04:11:45 2010
@@ -173,9 +173,6 @@
                    all(_imap(_eq, self.iteritems(), other.iteritems()))
         return dict.__eq__(self, other)
 
-    def __del__(self):
-        self.clear()                # eliminate cyclical references
-
 
 ################################################################################
 ### namedtuple

Modified: python/branches/release27-maint/Misc/NEWS
==============================================================================
--- python/branches/release27-maint/Misc/NEWS	(original)
+++ python/branches/release27-maint/Misc/NEWS	Sun Sep 12 04:11:45 2010
@@ -43,6 +43,13 @@
 Library
 -------
 
+- Issue #9825: removed __del__ from the definition of collections.OrderedDict.
+  This prevents user-created self-referencing ordered dictionaries from
+  becoming permanently uncollectable GC garbage.  The downside is that
+  removing __del__ means that the internal doubly-linked list has to wait for
+  GC collection rather than freeing memory immediately when the refcnt drops
+  to zero.
+
 - Issue #9816: random.Random.jumpahead(n) did not produce a sufficiently
   different internal state for small values of n.  Fixed by salting the 
   value.


More information about the Python-checkins mailing list