In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: ><[EMAIL PROTECTED]> wrote: >> >> I think I understand the original statement now. What you are really >> saying is that there is a pool of Python float objects (which can, at >> different times, wrap different values) which can grow but never >> decrease in size. So the memory held by this pool is dictated by the >> maximum number of floats that have ever been simultaneously active >> (accessible). >> >> The same goes for integers. All the more reason to avoid range(.) and >> use xrange(.). > >Uh? The integers produced as you loop over xrange will be just immortal >as those that get into the list built by range, so why is int >immortality any reason to use one over the other?
Because unless you save the ints produced by xrange(), you're reusing slots in the free list as you go through the loop, whereas range() chews up a gob of memory that will never get released even if you never otherwise use all the ints it produces. -- Aahz ([EMAIL PROTECTED]) <*> http://www.pythoncraft.com/ "19. A language that doesn't affect the way you think about programming, is not worth knowing." --Alan Perlis -- http://mail.python.org/mailman/listinfo/python-list