This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients ncoghlan, pitrou, rhettinger
Date 2010-12-17.18:06:54
SpamBayes Score 6.356518e-05
Marked as misclassified No
Message-id <1292609211.3672.38.camel@localhost.localdomain>
In-reply-to <1292608043.1.0.964921182453.issue10725@psf.upfronthosting.co.za>
Content
> Updated to use ABCs but still relies on user objects implementing
> __sizeof__.  So it is accurate whenever sys.getsizeof() is accurate.

I'm really -1 on this. It's better to give no measurement than to give a
totally wrong indication. The fact that you had to special-case
containers shows that getsizeof() is *not* the right solution for this.

(because if it was, you could rely on the containers' __sizeof__ instead
of overriding it)

The "size of an object and its contents" generally doesn't make any
sense, because the object graph is massively connected. getsizeof()
gives you the basic internal footprint of the object, but that's all.
It's really not a high-level tool for the everyday programmer, and
relying on it to say how much memory would be saved by getting rid of
certain objects is bogus.
History
Date User Action Args
2010-12-17 18:06:55pitrousetrecipients: + pitrou, rhettinger, ncoghlan
2010-12-17 18:06:54pitroulinkissue10725 messages
2010-12-17 18:06:54pitroucreate