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


---------- Forwarded message ----------
From: Antoine Pitrou <[email protected]>
Date: Mon, Jan 24, 2011 at 4:13 PM
Subject: [issue10994] implementation details in sys module
To: [email protected]



Antoine Pitrou <[email protected]> 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 <[email protected]>
<http://bugs.python.org/issue10994>
_______________________________________
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev

Reply via email to