Peter Otten wrote: > Alex Martelli wrote: > >> Integer objects that are once generated are kept around in a "free list" >> against the probability that they might be needed again in the future (a > > Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) > [GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. >>>> x = 1000 >>>> y = 1000 >>>> x is y > False > > Why don't x and y point to the same object then? > > Peter
Oops, I think I got it now. The actual objects are freed, only the memory is kept around for reuse with other ints... Peter -- http://mail.python.org/mailman/listinfo/python-list