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/setobject.c b/Objects/setobject.c
index 704d7e2..2faaf12 100644
--- a/Objects/setobject.c
+++ b/Objects/setobject.c
@@ -1940,7 +1940,7 @@
{
Py_ssize_t res;
- res = sizeof(PySetObject);
+ res = _PyObject_SIZE(Py_TYPE(so));
if (so->table != so->smalltable)
res = res + (so->mask + 1) * sizeof(setentry);
return PyLong_FromSsize_t(res);