Fwd: [issue10994] implementation details in sys module
I think this explanation what sys.getsizeof does is interesting. We
might want to have it.
---------- Forwarded message ----------
From: Antoine Pitrou
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
participants (1)
-
Maciej Fijalkowski