Alan Morgan wrote:
> In article <[EMAIL PROTECTED]>,
> Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>>* 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.
It has to work more like s[:]=[]
It's not easy for an object method to bind a whole different
object to the first object's name. Generally only
statements can affect namespaces (hence the uses of del that
everyone remembers.)
Mel.
--
http://mail.python.org/mailman/listinfo/python-list