Pop a list from beginning ? and memory saving...

Terry Reedy tjreedy at udel.edu
Wed Jun 5 04:29:26 CEST 2002


"Peter Hansen" <peter at engcorp.com> wrote in message
news:3CFD5B60.90831F21 at engcorp.com...
> >     self._v[:] = []
> I can't parse that.  What does it do?

Try the wonerful interactive interpreter:

>>> l = range(10)
>>> l
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> l[3:7] = []
>>> l
[0, 1, 2, 7, 8, 9]
>>> l[:] = []
>>> l
[]

Terry J. Reedy






More information about the Python-list mailing list