On 02/03/2015 10:57 PM, Danny Yoo wrote:

But what is the documented behavior of sys.getsizeof?

Reading...

     https://docs.python.org/3/library/sys.html#sys.getsizeof


Ah !

I was reading this:

        https://docs.python.org/2/library/sys.html#sys.getsizeof


The unlocking phrase:

"Only the memory consumption directly attributed to the object is
accounted for, not the memory consumption of objects it refers to."


seems to be present in the Python 3 doc, but not in Python 2's. I'll make sure to include the version in my future questions.


But the docs there also have a link to a recursive getsizeof() recipe
that does what I think you intend.  Take a look at that recipe.


Good luck!


Yeap, I see that. Thanks for your time!

--
~Jugurtha Hadjar,
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to