Daniel Dittmar <[EMAIL PROTECTED]> writes on Wed, 06 Jul 2005 16:12:46 +0200:
> Peter Hansen wrote:
> > Arguing the case for del: how would I, in doing automated testing,
> > ensure that I've returned everything to a "clean" starting point in
> > all cases if I can't delete variables?  Sometimes a global is the
> > simplest way to do something... how do I delete a global if not with
> > "del"?
> 
> 
> globals ().__delitem__ (varname)
> 
> except that the method would probably be called delete.

You now have a uniform way to remove an object from a namespace.

Why would you want to give each namespace its own method to
remove objects from it?

Can you imagine how much code you would break (would your proposal
to remove "del" got accepted)?


Dieter
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to