Issue #15424: Add a __sizeof__ implementation for array objects.

Patch by Ludwig Hähne.
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 5190c35..e26e9ad 100755
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -988,6 +988,19 @@
         a = array.array('H', b"1234")
         self.assertEqual(len(a) * a.itemsize, 4)
 
+    @support.cpython_only
+    def test_sizeof_with_buffer(self):
+        a = array.array(self.typecode, self.example)
+        basesize = support.calcvobjsize('4Pi')
+        buffer_size = a.buffer_info()[1] * a.itemsize
+        support.check_sizeof(self, a, basesize + buffer_size)
+
+    @support.cpython_only
+    def test_sizeof_without_buffer(self):
+        a = array.array(self.typecode)
+        basesize = support.calcvobjsize('4Pi')
+        support.check_sizeof(self, a, basesize)
+
 
 class StringTest(BaseTest):