Question about idioms for clearing a list

Bryan Olson fakeaddress at nowhere.org
Tue Feb 7 17:26:42 EST 2006


Fredrik Lundh wrote:
> Bryan Olson wrote:
> 
> 
>>So is consistency; it ain't Perl, thank Guido.
> 
> consistency is the hobgoblin of little minds.

Look up that saying. Any clues?


>>Python now has, what, three built-in mutable collections types:
>>lists, dictionaries, and sets. Dicts and sets both have a clear()
>>method and lists do not.
> 
> dicts and sets are mappings, and lists are not.

Sets are mappings?  Look up the terms, or check the library doc:

     http://docs.python.org/lib/lib.html


 > mappings don't
 > support slicing.  lists do.

Do they all have an empty state? Can you figure out what a clear()
method for lists should do, just from what it does for sets and
dicts?

> are you sure you know Python ?

Why would you post a messages like that?


-- 
--Bryan



More information about the Python-list mailing list