[Python-ideas] clear() method for lists
Michael Foord
fuzzyman at gmail.com
Fri Apr 3 20:33:37 CEST 2009
+1 from me
The current methods are all slightly ugly.
Michael
2009/4/3 Giampaolo Rodola' <gnewsg at gmail.com>
> On 3 Apr, 12:53, Andre Roberge <andre.robe... at gmail.com> wrote:
> > Hi everyone,
> >
> > 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[:] = []
> >
> > since the clear() method is currently the obvious way to remove all
> elements
> > from dict and set objects.
> >
> > I believe that this would be a lot more intuitive to beginners learning
> the
> > language, making Python more uniform.
> >
> > André
>
>
> I always wondered why there wasn't such a thing from the beginning.
> + 1 from me.
>
>
> --- Giampaolo
> http://code.google.com/p/pyftpdlib
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
--
http://www.ironpythoninaction.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090403/c260cc5c/attachment.html>
More information about the Python-ideas
mailing list