replacing instance __setattr__

Greg Ewing see_reply_address at something.invalid
Thu Jul 4 21:36:08 EDT 2002


Tim Peters wrote:

> The notion that data attributes are attached to instances while methods are
> attached to classes isn't unique to Python.


Smalltalk, for example, where methods and instance variables
are utterly different things, and methods are always looked
up in the instance's class (doing anything else wouldn't even
make sense).

It's the way that old-style Python classes blurred this
distinction that has been responsible for much of the
complexity and confusion during the old-to-new-syle
transition that we're now in the midst of. Hopefully,
when old-style classes go away altogether, things will
become simpler and more consistent.

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list