Re: delattr missing?

Guido Sohne (wgsohne@stone.princeton.edu)
Tue, 16 Aug 1994 14:06:15 GMT

>>>>>> "Guido" == Guido van Rossum <Guido.van.Rossum@cwi.nl> writes:
>In article <9408151307.AA07003=guido@voorn.cwi.nl> Guido.van.Rossum@cwi.nl writes:
>
>
>>> While manipulating class members by name, I noticed that there is:
>>>
>>> a=getattr(instance, 'member') # a=instance.member setattr(instance,
>>> 'member', a) # instance.member=a
>>>
>>> but no function to do "del instance.member" by name. Am I the only
>>> one to have stumbled onto this (minor) problem? Is there a way to
>>> do it?
>
>Guido> I guess it's just an oversight... And nobody missed it before.
>Guido> Would it be acceptable if instead of adding a new function, I
>Guido> add the "feature" that setattr(instance, 'member') is
>Guido> equivalent to del instance.member?
>

Ummm. It works but isnt it nicer to have del instance.member ? I think it
would be more logical and orthogonal. Internally it could be as you said.

--
Guido Sohne 
-- 
--
Guido Sohne                           EMail : wgsohne@phoenix.princeton.edu
Happy Linux user and soon to be lover/hater/basher of the OS/2 Warp II beta
Ethernet and TCP/IP for all ! Don't settle for SLIPing into the Internet !!