Re: list.clear() missing?!?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: list.clear() missing?!?

From: Alan Morgan <amorgan@xenon.Stanford.EDU>
Date: Thu Apr 13 2006 - 00:36:47 CEST

In article <1144870852.886477.238570@u72g2000cwu.googlegroups.com>,
Raymond Hettinger <python@rcn.com> wrote:
>[Steven Bethard]
>> I think these are all good reasons for adding a clear method, but being
>> that it has been so hotly contended in the past, I don't think it will
>> get added without a PEP. Anyone out there willing to take out the best
>> examples from this thread and turn it into a PEP?
>
>Something this small doesn't need a PEP. I'll just send a note to
>Guido asking for a pronouncement.
>
>Here's a draft list of pros and cons (any changes or suggestions are
>welcome):
>
>Pros:
>-----
>
>* s.clear() is more obvious in intent

Serious question: Should it work more like "s=[]" or more like
"s[:]=[]". I'm assuming the latter, but the fact that there is
a difference is an argument for not hiding this operation behind
some syntactic sugar.

Alan

-- 
Defendit numerus
Received on Sun Apr 30 23:02:22 2006