string copying

Tim Peters at
Sun Mar 31 20:26:13 CEST 2002

[Bengt Richter]
> Does python run out of memory gracefully?

> Very.  You should get a clean MemoryError exception if you try.
> >>> 'x' * 2**30
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> MemoryError

[Steve Holden]
> My laptop upgrade clearly takes my platform beyond the timbot conceptual
> limit: it took about three minutes to start printing (I'm not thinking of
> letting it finish) with no error message in sight.

Then you clearly have enough VM for a gigabyte string:  a MemoryError would
be inappropriate on your box in this case.  I suggest upgrading to Windows,
which dies quickly much more often <wink>.

More information about the Python-list mailing list