summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Lib/collections.py3
-rw-r--r--Misc/NEWS7
2 files changed, 7 insertions, 3 deletions
diff --git a/Lib/collections.py b/Lib/collections.py
index 10c8903697..b0c67a1825 100644
--- a/Lib/collections.py
+++ b/Lib/collections.py
@@ -173,9 +173,6 @@ class OrderedDict(dict, MutableMapping):
all(_imap(_eq, self.iteritems(), other.iteritems()))
return dict.__eq__(self, other)
- def __del__(self):
- self.clear() # eliminate cyclical references
-
################################################################################
### namedtuple
diff --git a/Misc/NEWS b/Misc/NEWS
index b65e860932..a31d95aee8 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -43,6 +43,13 @@ Core and Builtins
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.