Re: How to clear a list (3 ways).

2008-03-07 Thread John Machin
On Mar 8, 1:49 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 07 Mar 2008 09:39:05 -0200, <[EMAIL PROTECTED]> > escribi�: > > > Executive summary : What idiom do you use for resetting a list ? > >lst = |] # (1) > >lst[:] = [] # (2) > >del lst[:] # (3) > > (3) if I wan

Re: How to clear a list (3 ways).

2008-03-07 Thread Gabriel Genellina
En Fri, 07 Mar 2008 09:39:05 -0200, <[EMAIL PROTECTED]> escribi�: > Executive summary : What idiom do you use for resetting a list ? >lst = |] # (1) >lst[:] = [] # (2) >del lst[:] # (3) (3) if I want to keep the same list else (1) An example when (1) is desirable: # generate