list.clear() missing?!?

Georg Brandl g.brandl-nospam at gmx.net
Thu Apr 13 04:05:26 EDT 2006


Duncan Booth wrote:
> Peter Hansen wrote:
> 
>>> * learning slices is basic to the language (this lesson shouldn't be
>>> skipped)
>> 
>> And yet it doesn't appear to be in the tutorial.  I could have missed 

> Both of these talk about ways to remove slices from a list. Perhaps the 
> wording could be clearer to make it obvious that they can also be used to 
> clear a list entirely (using the word 'clear' would certainly help people 
> Googling for the answer). So maybe 'this can even change the size of the 
> list or clear it completely' would be a good change for 3.1.4.

I added two examples of clearing a list to the section about slice assignment
and del.

Georg



More information about the Python-list mailing list