Issue 9865: add __sizeof__ to OrderedDict.
diff --git a/Lib/test/test_collections.py b/Lib/test/test_collections.py
index 514dc39..51e93e4 100644
--- a/Lib/test/test_collections.py
+++ b/Lib/test/test_collections.py
@@ -994,6 +994,12 @@
with self.assertRaises(KeyError):
od.move_to_end('x')
+ def test_sizeof(self):
+ # Wimpy test: Just verify the reported size is larger than a regular dict
+ d = dict(a=1)
+ od = OrderedDict(**d)
+ self.assertGreater(sys.getsizeof(od), sys.getsizeof(d))
+
class GeneralMappingTests(mapping_tests.BasicTestMappingProtocol):
type2test = OrderedDict