Antoine Pitrou added the comment: > The point is that your patch breaks functions like gettotalsizeof(). > It makes impossible to get a total size of general object.
The thing is, "Total size" is generally meaningless. It can include things such as the object's type, or anything transitively referenced by the object, such as modules. > It will be better to add gettotalsizeof() to the stdlib (or add an > optional parameter to sys.getsizeof() for recursive counting). This patch has *nothing* to do with recursive counting. It counts the internal arrays of itertools.tee() as part of its memory size, which is reasonable and expected. It does *not* count memory recursively: it doesn't count the size of the itertools.tee()'s cached objects, for example. Recursive counting doesn't make sense with Python. Where do you stop counting? ---------- _______________________________________ 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