4 ms·
It's not mentioned in this article, but Python 2.6 objects have a __sizeof__ method, used by sys.getsizeof(): >>> help(sys.getsizeof) Help on built-in func
by yangyang 17y ago
It's not mentioned in this article, but Python 2.6 objects have a __sizeof__ method, used by sys.getsizeof():
>>> help(sys.getsizeof)
Help on built-in function getsizeof in module sys:
getsizeof(...)
getI(object, default) -> int
Return the size of object in bytes.
http://bugs.python.org/issue2898 http://bugs.python.org/issue2898