[Tutor] object size in python is in what units?

Jim Mooney cybervigilante at gmail.com
Tue Jul 23 20:27:41 CEST 2013


On 23 July 2013 07:21, Oscar Benjamin <oscar.j.benjamin at gmail.com> wrote:

>
>
> You can check the size in bytes of an object with sys.getsizeof e.g.:
>
> >>> import sys
> >>> sys.getsizeof(lardKronk)
> 36
>

And yet I still get 36 with this:

bigKronk = Kronk('supercalifracilisticexpalidocious, even though the sound
of it is really quite atrocious')
sys.getsizeof(bigKronk)
36

So I guess the object is only pointing to its contents.  Which I assume
means an object is just a bunch of names bound to pointers.

Jim
An excellent animation/graph of the accelerating disappearance of arctic
sea ice, which controls
climate stability in the Northern hemisphere:
https://www.youtube.com/watch?v=YgiMBxaL19M
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130723/11bd5315/attachment.html>


More information about the Tutor mailing list