data size

Steve Holden sholden at holdenweb.com
Fri Nov 9 22:37:28 CET 2001


"harry" <hartanto at telusplanet.net> wrote in message
news:iAVG7.35100$i4.5713453 at news0.telusplanet.net...
>
> "Martin von Loewis" <loewis at informatik.hu-berlin.de> wrote in message
> news:j4k7x084sy.fsf at informatik.hu-berlin.de...
>
> > This is invalid syntax, I'll assume that you meant
> >
> > {"key1":[1,2,3,4], "key2": "hello", "key3": [1,2,3]}
> >
> > Notice that dict is now a collection of 11 objects:
> > - four strings
> > - four integers: 1,2,3,4
> > - two lists: [1,2,3,4] and [1,2,3]
> > - one dictionary
> >
> > You may think that the integers should be counted twice, but you
> > actually have the same integer objects in each list.
> >
> > Do you want the siye of just the dictionary, or of all the objects
> > together? What Python version? What operating system/microprocessor?
> > What C library (to account for the overhead of malloc/free).
>
> I would like to know the size of all objects together (the dictionary and
> the contents). I am using Python 2.0 on Windows98 SE.
> And I don't think I use any C library. (or you're refering to something
that
> i'm not aware of using)

He is probably asking you which C library your version of Python was
compiled with. But you don't need to know that, either.

All Python dictionaries are a standard 2.5 cm by 3.6cm. Integers have no
width and are all 1.2 cm in length. Strings are all 2 mm times the number of
characters, except Unicode strings, which are 4 mm times the number of
characters.

regards
 Steve
--
http://www.holdenweb.com/








More information about the Python-list mailing list