[Beginner] delete items of [] also from memory

Steven Bethard steven.bethard at gmail.com
Mon Nov 22 13:37:44 EST 2004


F. Petitjean wrote:
> What about   A[:] = None  ?

I don't think that does what you want it to:

 >>> a = [None]*100
 >>> a[:] = None
Traceback (most recent call last):
   File "<interactive input>", line 1, in ?
TypeError: can only assign an iterable

Steve



More information about the Python-list mailing list