[Python-Dev] List copy and clear (was Re: Inconsistent API for sets.Set and build-in set)

Fred L. Drake, Jr. fdrake at acm.org
Thu Jun 30 23:43:32 CEST 2005


On Thursday 30 June 2005 17:26, Raymond Hettinger wrote:
 > the current idiom:
 >
 >    mylist[:] = []       # clear

Unless you happen to prefer the other current idiom:

    del mylist[:]


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>


More information about the Python-Dev mailing list