[Python-Dev] Re: 2.2=>2.3 object.__setattr__(cls,attr,value)

David Eppstein eppstein at ics.uci.edu
Tue Nov 18 23:27:26 EST 2003


In article <1069214841.6983.59.camel at localhost.localdomain>,
 Jeremy Hylton <jeremy at alum.mit.edu> wrote:

> The change was reported on python-dev, but apparently got left out of
> the NEWS file.  Here are the details:
> http://mail.python.org/pipermail/python-dev/2003-April/034605.html

Thanks!  Now that you mention it, I vaguely remember something of that 
discussion.  But the messages there seem to be mostly or entirely about 
preventing __setattr__ on built-in types (justifiably called "evil" in 
the thread) while the code I needed this for was to do it on my own 
types.  Was there some other discussion about preventing 
object.__setattr__ on non-builtins or was this just an unintended 
consequence?  Not that it matters much now, it's done...

Of course, all of this has led me to realize that my code was 
unnecessarily obscure: I should have just used setattr(cls,...)

-- 
David Eppstein                      http://www.ics.uci.edu/~eppstein/
Univ. of California, Irvine, School of Information & Computer Science




More information about the Python-Dev mailing list