Deep version of sys.getsizeof [duplicate]

怎甘沉沦 提交于 2019-11-27 16:08:12

I think that Pympler has already beaten you to the punch on this one.

From their documentation:

>>> from pympler.asizeof import asizeof
>>> obj = [1, 2, (3, 4), 'text']
>>> asizeof(obj)
176

If you want a specific example, you can find the source for asizeof here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!