diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-19 18:07:11 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-12-19 18:07:11 (GMT) |
commit | a9406e77fa7bd3618c16edd248c24010af7035c1 (patch) | |
tree | 885dac8e53616cebafbb37bc5613040513bd9581 /Objects/dictobject.c | |
parent | a254921cd4c1ca22d725872601292c48b7caa20a (diff) | |
parent | 5c4064e8bd199d70eefd7ec24766957c22f1b8e8 (diff) | |
download | cpython-a9406e77fa7bd3618c16edd248c24010af7035c1.zip cpython-a9406e77fa7bd3618c16edd248c24010af7035c1.tar.gz cpython-a9406e77fa7bd3618c16edd248c24010af7035c1.tar.bz2 |
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/dictobject.c')
-rw-r--r-- | Objects/dictobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 4a72c9a..752853f 100644 --- a/Objects/dictobject.c +++ b/Objects/dictobject.c @@ -2563,7 +2563,7 @@ _PyDict_SizeOf(PyDictObject *mp) Py_ssize_t size, res; size = DK_SIZE(mp->ma_keys); - res = sizeof(PyDictObject); + res = _PyObject_SIZE(Py_TYPE(mp)); if (mp->ma_values) res += size * sizeof(PyObject*); /* If the dictionary is split, the keys portion is accounted-for |