[Python-ideas] clear() method for lists

Andre Roberge andre.roberge at gmail.com
Fri Apr 3 12:53:29 CEST 2009

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[:]
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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20090403/605c9239/attachment.html>

More information about the Python-ideas mailing list