[issue14055] Implement __sizeof__ for etree Element

2012-06-17 Thread Martin v . Löwis
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.

[issue14055] Implement __sizeof__ for etree Element

2012-06-17 Thread Roundup Robot
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

[issue14055] Implement __sizeof__ for etree Element

2012-06-17 Thread Martin v . Löwis
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 ___

[issue14055] Implement __sizeof__ for etree Element

2012-06-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14055 ___ ___ Python-bugs-list

[issue14055] Implement __sizeof__ for etree Element

2012-06-16 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +eli.bendersky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14055 ___ ___ Python-bugs-list

[issue14055] Implement __sizeof__ for etree Element

2012-06-16 Thread Eli Bendersky
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

[issue14055] Implement __sizeof__ for etree Element

2012-06-16 Thread Martin v . Löwis
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

[issue14055] Implement __sizeof__ for etree Element

2012-06-16 Thread Eli Bendersky
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

[issue14055] Implement __sizeof__ for etree Element

2012-02-19 Thread Martin v . Löwis
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

[issue14055] Implement __sizeof__ for etree Element

2012-02-19 Thread Antoine Pitrou
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

[issue14055] Implement __sizeof__ for etree Element

2012-02-19 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14055 ___