[issue28959] Add a macro for dict size

STINNER Victor report at bugs.python.org
Wed Dec 14 10:15:03 EST 2016


STINNER Victor added the comment:

I wrote a short script to check the size of dict:
---
import sys

def size(obj):
    print(sys.getsizeof(obj))

size({})
size({i:i for i in range(3)})
size({i:i for i in range(10)})
size({i:i for i in range(100)})
---

On Linux x86_64, the sizes don't change with the patch:

240
240
368
4704

A size increase would be a regression, but it's not the case, so it's fine ;-)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28959>
_______________________________________


More information about the Python-bugs-list mailing list