Martin v. Löwis added the comment:

Antoine: in (my experience of) memory analysis, the size of a single object is 
mostly irrelevant. If you need to know how much memory something consumes, you 
typically want to know the memory of a set of objects. So this is the case that 
really must be supported.

For that, users will have to use libraries that know how to count memory. It's 
not asked to much that the authors of such libraries know about internals of 
Python (such as the existence of sys.getsizeof, or gc.get_referents). The 
question is: can such a library reasonably implemented? For that, it is 
important that getsizeof behaves uniformly across objects.

If you really don't like the proposed uniformity, please propose a different 
rule. However, don't give deviations in other places (OrderedDict) as a reason 
to break the rule here as well. Instead, if OrderedDict.__getsizeof__ is 
broken, it needs to be fixed as well.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19048>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to