[Beginner] delete items of [] also from memory

Steven Bethard steven.bethard at gmail.com
Mon Nov 22 19:37:44 CET 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


More information about the Python-list mailing list