[Python-Dev] infinities

Phillip J. Eby pje at telecommunity.com
Sun Nov 26 18:59:13 CET 2006

At 07:07 PM 11/26/2006 +0200, tomer filiba wrote:
> > sys.maxint makes more sense there.
>no, it requires *infinity* to accomplish x - y == x; y != 0, for example:
>while limit > 0:
>     limit -= len(chunk)

Um, you do realize that you're not going to be able to fit sys.maxint 
strings into a list, right?  That's over 2 billion *pointers* worth of 
memory, so at least 8 gigabytes on a 32-bit machine...  that probably can't 
address more than 4 gigabytes of memory to start with.  The code will fail 
with MemoryError long before you exhaust sys.maxint, even in the case where 
you're using only 1-character strings.

More information about the Python-Dev mailing list