[Python-ideas] clear() method for lists
andre.roberge at gmail.com
Sat Apr 4 01:36:46 CEST 2009
On Fri, Apr 3, 2009 at 8:33 PM, Ben Finney
<ben+python at benfinney.id.au<ben%2Bpython at benfinney.id.au>
> George Sakkis <george.sakkis at gmail.com> writes:
> > On Fri, Apr 3, 2009 at 6:53 AM, Andre Roberge <andre.roberge at gmail.com>
> > > On the general Python list, a suggestion was made to add a clear()
> method to
> > > list, as the "obvious" way to do
> > > del some_list[:]
> > > or
> > > some_list[:] = 
> > It's obviously more explicit, but at the same it's a rather
> > infrequent operation and the current ways are not particularly ugly.
> More than explicit, it would make ‘clear’ the One Obvious Way To Do It
> for base collection types. +1 from me.
Seeing mostly positive responses so far ... Is it worth writing a pre-PEP to
formalize this suggestion?
> \ “It's a good thing we have gravity or else when birds died |
> `\ they'd just stay right up there. Hunters would be all |
> _o__) confused.” —Steven Wright |
> Ben Finney
> Python-ideas mailing list
> Python-ideas at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas