forcing list garbage collection

Terry Reedy tjreedy at udel.edu
Fri Oct 11 14:47:47 EDT 2002


"les" <abidnego25 at yahoo.com> wrote in message
news:653cf871.0210111009.5128832a at posting.google.com...
> Hi,
> dictionaries have a clear() method, do lists have something similar?
> i would like to list to empty and memory recollected right away.

>>> l = range(10)
>>> l[:]=[] #<<<<=========
>>> l
[]

Terry J. Reedy





More information about the Python-list mailing list