Martin v. Löwis mar...@v.loewis.de added the comment:
Given how C's sizeof works, it may be debatable whether it's natural to expect
that sys.getsizeof should be recursive. If you have a struct with pointers
(say, char*) in C, and you do sizeof, the string length isn't considered,
either.
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 093dec81ea1f by Martin v. Löwis in branch 'default':
Issue #14055: Add __sizeof__ support to _elementtree.
http://hg.python.org/cpython/rev/093dec81ea1f
--
nosy: +python-dev
Changes by Martin v. Löwis mar...@v.loewis.de:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14055
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14055
___
___
Python-bugs-list
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +eli.bendersky
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14055
___
___
Python-bugs-list
Eli Bendersky eli...@gmail.com added the comment:
Out of curiosity, why don't the constituents of Element (i.e. the tag, the
attributes dict, etc.) count for its size?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14055
Martin v. Löwis mar...@v.loewis.de added the comment:
__sizeof__ is supposed to account for just the object, not for the size of any
object it refers to. If you want to compute total memory consumption, you
should get a list of all objects, and then sum up __sizeof__. If some object
would
Eli Bendersky eli...@gmail.com added the comment:
Martin, thanks for the explanation. The patch LGTM, then.
Could it be useful to document this a bit more explicitly in the description of
sys.getsizeof? The most intuitive thing to expect from it is to compute the
*total* size including
New submission from Martin v. Löwis mar...@v.loewis.de:
The cElementTree Element currently returns an incorrect response to
sys.getsizeof, as it doesn't account for the extra structure, and for the child
pointers array. This patch corrects the computation.
--
files: sizeof.diff
Changes by Antoine Pitrou pit...@free.fr:
--
components: +Library (Lib)
nosy: +flox
stage: - patch review
type: - enhancement
versions: +Python 3.3
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14055
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:
--
nosy: +Arfrever
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14055
___
11 matches
Mail list logo