Is there no compression support for large sized strings in Python?

Fredrik Lundh fredrik at pythonware.com
Thu Dec 1 18:10:19 CET 2005


Harald Karner wrote:

> I tried on a Sun with 16GB Ram (Python 2.3.2)
> seems like 2GB is the limit for string size:
>
> > python -c "print len('m' * 2048*1024*1024)"
> Traceback (most recent call last):
>   File "<string>", line 1, in ?
> OverflowError: repeated string is too long
>
> > python -c "print len('m' * ((2048*1024*1024)-1))"
> 2147483647

the string type uses the ob_size field to hold the string length, and
ob_size is an integer:

$ more Include/object.h
    ...
    int ob_size; /* Number of items in variable part */
    ...

anyone out there with an ILP64 system?

</F> 






More information about the Python-list mailing list