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

Peter Hansen peter at engcorp.com
Tue Jun 4 20:29:20 EDT 2002


François Pinard wrote:
> 
> [Shagshag13]
> 
> >  def reset(self):
> >   del self._v
> >   self._v = []
> 
> Just for the record, one could also write, in one line:
> 
>     self._v[:] = []
> 
> Probably unneeded in this case, but it is useful when one wants to keep
> extra references to the list, and empty it nevertheless.

I can't parse that.  What does it do?

-Peter



More information about the Python-list mailing list