replacing instance __setattr__

Tim Peters tim.one at comcast.net
Thu Jul 4 16:54:49 EDT 2002


[Robin Becker]
> that's my confusion. Also as you point out I seem to think that methods
> are data attributes which are callable, obviously my failure again.

The notion that data attributes are attached to instances while methods are
attached to classes isn't unique to Python.  Most Python programmers don't
have to worry about the distinction, but if you're doing metaprogramming or
introspection tricks, then you have to learn how the language actually
works.

> I obviously come from a more dynamic direction all these distinctions
> seem pretty arcane and silly to tcler's, lispers, gpmers etc.

Tcl isn't an OO language so I don't see its relevance.  I don't know what
gpmers refers to.  WRT Lisp I can't guess whether you have CL's CLOS in mind
or some other Lisp's OO package.  They all have their own quirks, although
AFAIK a distinction between classes and instances is made by all OO
languages except the handful of prototype-based languages.






More information about the Python-list mailing list