I think this explanation what sys.getsizeof does is interesting. We
might want to have it.


---------- Forwarded message ----------
From: Antoine Pitrou <rep...@bugs.python.org>
Date: Mon, Jan 24, 2011 at 4:13 PM
Subject: [issue10994] implementation details in sys module
To: fij...@gmail.com



Antoine Pitrou <pit...@free.fr> added the comment:

> I suppose wrt getsizeof it's more of "if you provide us with a
> reasonable expectations, we can implement this" other than anything
> else.

The expectation is that it returns the memory footprint of the given
object, and only it (not taking into account sharing, caching,
dependencies or anything else). For example, an instance will not count
its attribute __dict__. But a str object will count its object header
plus the string payload, if the payload is private.

Of course, you are free to tweak these semantics for the PyPy
implementation.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10994>
_______________________________________
_______________________________________________
pypy-dev@codespeak.net
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to