Couple of simple questions

Rikard Bosnjakovic bos at hack.org
Sat Mar 31 07:23:04 EST 2001


nomad wrote:

> Does anybody know what size python variabel types are?
> Eg. how many bytes is and integer?  What about a long?  I have

Table 3.9 in "Python Essential reference" by Beazley:

Type (built-in)          Size
Integer                  12 bytes
Long Integer             12 bytes + (nbits/16 + 1)*2 bytes
Float                    16 bytes
Complex                  24 bytes
List                     16 bytes + 4 bytes for each item
Tuple                    16 bytes + 4 bytes for each item
String                   20 bytes + 1 byte per character
Dictionary               24 bytes + 12*2^n bytes, n = log2 (nitems)+1
Class Instance           16 bytes + a dictionary object
Xrange object            24 bytes



-- 
Rikard Bosnjakovic - http://a214.ryd.student.liu.se/cv/ - ICQ: 1158217

Anyone sending unwanted advertising e-mail to my address will be
charged $250 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.



More information about the Python-list mailing list