Optimizing code

Moshe Zadka moshez at math.huji.ac.il
Fri Feb 25 17:26:46 CET 2000

On 25 Feb 2000, Harald Hanche-Olsen wrote:

> Presumably because the address space is still 32 bits, and no object
> in memory can conceivably be longer than 2**32.  (In any case I found
> your use of __len__ to be slightly offensive.)  But wait, you sure
> *could* imagine an object longer than 2**31, and since python ints are
> signed, then len() would turn out to be negative.

Ummmm.....xrange() uses O(1) memory, so it should be able to be as long
as I want: what if I want to count to 2^33?

This is a limitation, pure and simple. Thankfully, it's fixed in the CVS
version (thanks, Andrew!), so it'll be all right in 1.6.

or-you-can-live-on-the-edge-and-use-the-cvs-version-ly y'rs, Z.
Moshe Zadka <mzadka at geocities.com>. 
INTERNET: Learn what you know.
Share what you don't.

More information about the Python-list mailing list