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

Peter Hansen peter at engcorp.com
Wed Jun 5 02:29:20 CEST 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