summaryrefslogtreecommitdiff
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-12-19 20:05:25 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-12-19 20:05:25 +0200
commite7fe1d033e834d6b4deb61eb6fe5984e11fb5fc0 (patch)
tree700e38886aa7e072961d17f00a76460487f97e1a /Objects/listobject.c
parent30434d7ad8841a0354bd84d808dba7e2fe9a6988 (diff)
downloadcpython-e7fe1d033e834d6b4deb61eb6fe5984e11fb5fc0.tar.gz
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.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 45e54ce31d..eee7c68e9e 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2324,7 +2324,7 @@ list_sizeof(PyListObject *self)
{
Py_ssize_t res;
- res = sizeof(PyListObject) + self->allocated * sizeof(void*);
+ res = _PyObject_SIZE(Py_TYPE(self)) + self->allocated * sizeof(void*);
return PyLong_FromSsize_t(res);
}