[issue14520] Buggy Decimal.__sizeof__

Martin v. Löwis report at bugs.python.org
Sun Apr 8 19:30:56 CEST 2012


Martin v. Löwis <martin at v.loewis.de> added the comment:

There are really two options:

a) if an object is a container, and the contained is accessible to reflection (preferably through gc.get_referents), then the container shouldn't account for the size of the contained.
b) if the contained is not accessible (except for sys.get_objects() in a debug build), then the container should provide the total sum.

A memory debugger is supposed to find all objects (e.g. through gc.get_objects, and gc.get_referents), eliminate duplicate references, and then apply sys.getsizeof for each object. This should then not leave out any memory, and not count any memory twice.

----------
nosy: +loewis

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


More information about the Python-bugs-list mailing list