Issue #25421: __sizeof__ methods of builtin types now use dynamic basic size.
This allows sys.getsize() to work correctly with their subclasses with
__slots__ defined.
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 1f43ba2..27365b6 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2469,7 +2469,7 @@
 {
     Py_ssize_t res;
 
-    res = sizeof(PyListObject) + self->allocated * sizeof(void*);
+    res = _PyObject_SIZE(Py_TYPE(self)) + self->allocated * sizeof(void*);
     return PyInt_FromSsize_t(res);
 }